Package org.exolab.castor.xml.schema
Class SimpleTypesFactory
java.lang.Object
org.exolab.castor.xml.schema.SimpleTypesFactory
SimpleTypesFactory provides code constants for every built
in type defined in www.w3.org/TR/xmlschma-2-20000407
USER_TYPE is used for user derived types.
This factory can also create instances of classes derived from SimpleType
that represent the simple types defined by xmlschema and those derived from them.
- Version:
- $Revision: 8145 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
- Author:
- Arnaud Berry
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
This code is for errors or uninitialized types.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
(package private) static final String
The resource location for the built-in types property files.static final int
static final int
static final int
static final int
(package private) static final String
The resource for the Simple types.(package private) static final String
The resource for the mapping properties.static final int
static final int
static final int
static final int
static final int
Simple type defined by the user. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) SimpleType
createUserSimpleType
(Schema schema, String name, String baseName, String derivation, boolean createDeferredSimpleType) Creates an instance of a class derived from SimpleType, representing the user type defined by the given name, baseName and derivation method.(package private) SimpleType
createUserSimpleType
(Schema schema, String name, SimpleType baseType, String derivation) Creates an instance of a class derived from SimpleType, representing the user type defined by the given name, baseName and derivation method.getBuiltInType
(String typeName) Gets an instance of a class derived fromSimpleType
representing the built in type which name is given as a parameter.getBuiltInTypeName
(int builtInTypeCode) Gets a built in type's name given its code.static boolean
isBuiltInType
(int codeType) Indicates if a type code corresponds to an xml schema built in type.static boolean
isDateTimeType
(int codeType) Tells if a type code corresponds to an xml schema (built-in) date/time type.static boolean
isNumericType
(int codeType) Tells if a type code corresponds to an xml schema (built-in) numeric type.static boolean
isPrimitiveType
(int codeType) Tells if a type code corresponds to an xml schema (built-in) primitive type.
-
Field Details
-
INVALID_TYPE
public static final int INVALID_TYPEThis code is for errors or uninitialized types.- See Also:
-
USER_TYPE
public static final int USER_TYPESimple type defined by the user.- See Also:
-
STRING_TYPE
public static final int STRING_TYPE- See Also:
-
DURATION_TYPE
public static final int DURATION_TYPE- See Also:
-
DATETIME_TYPE
public static final int DATETIME_TYPE- See Also:
-
TIME_TYPE
public static final int TIME_TYPE- See Also:
-
DATE_TYPE
public static final int DATE_TYPE- See Also:
-
GYEARMONTH_TYPE
public static final int GYEARMONTH_TYPE- See Also:
-
GYEAR_TYPE
public static final int GYEAR_TYPE- See Also:
-
GMONTHDAY_TYPE
public static final int GMONTHDAY_TYPE- See Also:
-
GDAY_TYPE
public static final int GDAY_TYPE- See Also:
-
GMONTH_TYPE
public static final int GMONTH_TYPE- See Also:
-
BOOLEAN_TYPE
public static final int BOOLEAN_TYPE- See Also:
-
BASE64BINARY_TYPE
public static final int BASE64BINARY_TYPE- See Also:
-
HEXBINARY_TYPE
public static final int HEXBINARY_TYPE- See Also:
-
FLOAT_TYPE
public static final int FLOAT_TYPE- See Also:
-
DOUBLE_TYPE
public static final int DOUBLE_TYPE- See Also:
-
DECIMAL_TYPE
public static final int DECIMAL_TYPE- See Also:
-
ANYURI_TYPE
public static final int ANYURI_TYPE- See Also:
-
QNAME_TYPE
public static final int QNAME_TYPE- See Also:
-
NOTATION_TYPE
public static final int NOTATION_TYPE- See Also:
-
NORMALIZEDSTRING_TYPE
public static final int NORMALIZEDSTRING_TYPE- See Also:
-
TOKEN_TYPE
public static final int TOKEN_TYPE- See Also:
-
LANGUAGE_TYPE
public static final int LANGUAGE_TYPE- See Also:
-
NAME_TYPE
public static final int NAME_TYPE- See Also:
-
NCNAME_TYPE
public static final int NCNAME_TYPE- See Also:
-
ID_TYPE
public static final int ID_TYPE- See Also:
-
IDREF_TYPE
public static final int IDREF_TYPE- See Also:
-
IDREFS_TYPE
public static final int IDREFS_TYPE- See Also:
-
ENTITY_TYPE
public static final int ENTITY_TYPE- See Also:
-
ENTITIES_TYPE
public static final int ENTITIES_TYPE- See Also:
-
NMTOKEN_TYPE
public static final int NMTOKEN_TYPE- See Also:
-
NMTOKENS_TYPE
public static final int NMTOKENS_TYPE- See Also:
-
INTEGER_TYPE
public static final int INTEGER_TYPE- See Also:
-
NON_POSITIVE_INTEGER_TYPE
public static final int NON_POSITIVE_INTEGER_TYPE- See Also:
-
NEGATIVE_INTEGER_TYPE
public static final int NEGATIVE_INTEGER_TYPE- See Also:
-
LONG_TYPE
public static final int LONG_TYPE- See Also:
-
INT_TYPE
public static final int INT_TYPE- See Also:
-
SHORT_TYPE
public static final int SHORT_TYPE- See Also:
-
BYTE_TYPE
public static final int BYTE_TYPE- See Also:
-
NON_NEGATIVE_INTEGER_TYPE
public static final int NON_NEGATIVE_INTEGER_TYPE- See Also:
-
UNSIGNED_LONG_TYPE
public static final int UNSIGNED_LONG_TYPE- See Also:
-
UNSIGNED_INT_TYPE
public static final int UNSIGNED_INT_TYPE- See Also:
-
UNSIGNED_SHORT_TYPE
public static final int UNSIGNED_SHORT_TYPE- See Also:
-
UNSIGNED_BYTE_TYPE
public static final int UNSIGNED_BYTE_TYPE- See Also:
-
POSITIVE_INTEGER_TYPE
public static final int POSITIVE_INTEGER_TYPE- See Also:
-
ANYSIMPLETYPE_TYPE
public static final int ANYSIMPLETYPE_TYPE- See Also:
-
RESOURCE_LOCATION
The resource location for the built-in types property files.- See Also:
-
TYPE_MAPPINGS
The resource for the mapping properties.- See Also:
-
TYPE_DEFINITIONS
The resource for the Simple types.- See Also:
-
-
Constructor Details
-
SimpleTypesFactory
public SimpleTypesFactory()
-
-
Method Details
-
isBuiltInType
public static boolean isBuiltInType(int codeType) Indicates if a type code corresponds to an xml schema built in type.- Parameters:
codeType
- The type code to check.- Returns:
- True if the given type code represents an XML schema built-in type.
-
isPrimitiveType
public static boolean isPrimitiveType(int codeType) Tells if a type code corresponds to an xml schema (built-in) primitive type.- Parameters:
codeType
- The type code to check.- Returns:
- True if the given type code represents an XML schema built-in primitive type.
-
isNumericType
public static boolean isNumericType(int codeType) Tells if a type code corresponds to an xml schema (built-in) numeric type.- Parameters:
codeType
- The type code to check.- Returns:
- True if the given type code represents an XML schema built-in numeric type.
-
isDateTimeType
public static boolean isDateTimeType(int codeType) Tells if a type code corresponds to an xml schema (built-in) date/time type.- Parameters:
codeType
- The type code to check.- Returns:
- True if the given type code represents an XML schema built-in date/time type.
-
getBuiltInType
Gets an instance of a class derived fromSimpleType
representing the built in type which name is given as a parameter.- Parameters:
typeName
- Name of the simple type.- Returns:
- The
SimpleType
instance for the type name.
-
getBuiltInTypeName
Gets a built in type's name given its code. -
createUserSimpleType
SimpleType createUserSimpleType(Schema schema, String name, String baseName, String derivation, boolean createDeferredSimpleType) Creates an instance of a class derived from SimpleType, representing the user type defined by the given name, baseName and derivation method. Package private (used by Schema and DeferredSimpleType). The given schema is used as the owning Schema document, yet a call to schema.addSimpleType must till be made to add the SimpleType to the Schema. If the base type is not found in the schema, a DeferredSimpleType will be returned if createDeferredSimpleType is true, null otherwise.- Parameters:
schema
- the owning schemaname
- the name of the SimpleTypebaseName
- the name of the SimpleType's base typederivation
- the name of the derivation method (null/""/"list"/"restriction")createDeferredSimpleType
- should the type be deferred if it can't be created.- Returns:
- the new SimpleType, or null if its parent could not be found.
-
createUserSimpleType
Creates an instance of a class derived from SimpleType, representing the user type defined by the given name, baseName and derivation method. Package private (used by Schema and DeferredSimpleType). The given schema is used as the owning Schema document, yet a call to schema#addSimpleType must still be made to add the SimpleType to the Schema if the SimpleType is not anonymous. If the base type is not found in the schema, a DeferredSimpleType will be returned if createDeferredSimpleType is true, null otherwise.- Parameters:
schema
- the owning schemaname
- the name of the SimpleTypebaseType
- the base typederivation
- the name of the derivation method (null/""/"list"/"restriction")- Returns:
- the new SimpleType, or null if its parent could not be found.
-