org.exolab.castor.xml.schema

Class SimpleTypesFactory

public class SimpleTypesFactory extends Object

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: 6015 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $

Author: Arnaud Berry

Field Summary
static intANYSIMPLETYPE_TYPE
static intANYURI_TYPE
static intBASE64BINARY_TYPE
static intBOOLEAN_TYPE
static intBYTE_TYPE
static intDATETIME_TYPE
static intDATE_TYPE
static intDECIMAL_TYPE
static intDOUBLE_TYPE
static intDURATION_TYPE
static intENTITIES_TYPE
static intENTITY_TYPE
static intFLOAT_TYPE
static intGDAY_TYPE
static intGMONTHDAY_TYPE
static intGMONTH_TYPE
static intGYEARMONTH_TYPE
static intGYEAR_TYPE
static intHEXBINARY_TYPE
static intIDREFS_TYPE
static intIDREF_TYPE
static intID_TYPE
static intINTEGER_TYPE
static intINT_TYPE
static intINVALID_TYPE
This code is for errors or uninitialized types.
static intLANGUAGE_TYPE
static intLONG_TYPE
static intNAME_TYPE
static intNCNAME_TYPE
static intNEGATIVE_INTEGER_TYPE
static intNMTOKENS_TYPE
static intNMTOKEN_TYPE
static intNON_NEGATIVE_INTEGER_TYPE
static intNON_POSITIVE_INTEGER_TYPE
static intNORMALIZEDSTRING_TYPE
static intNOTATION_TYPE
static intPOSITIVE_INTEGER_TYPE
static intQNAME_TYPE
static StringRESOURCE_LOCATION
The resource location for the built-in types property files
static intSHORT_TYPE
static intSTRING_TYPE
static intTIME_TYPE
static intTOKEN_TYPE
static StringTYPE_DEFINITIONS
The resource for the Simple types
static StringTYPE_MAPPINGS
The resource for the mapping properties
static intUNSIGNED_BYTE_TYPE
static intUNSIGNED_INT_TYPE
static intUNSIGNED_LONG_TYPE
static intUNSIGNED_SHORT_TYPE
static intUSER_TYPE
Simple type defined by the user
Method Summary
SimpleTypecreateUserSimpleType(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.
SimpleTypecreateUserSimpleType(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.
SimpleTypegetBuiltInType(String typeName)
Gets an instance of a class derived from SimpleType representing the built in type which name is given as a parameter.
StringgetBuiltInTypeName(int builtInTypeCode)
Gets a built in type's name given its code.
static booleanisBuiltInType(int codeType)
Tells if a type code corresponds to an xml schema built in type
static booleanisPrimitiveType(int codeType)
Tells if a type code corresponds to an xml schema (built in) primitive type

Field Detail

ANYSIMPLETYPE_TYPE

public static final int ANYSIMPLETYPE_TYPE

ANYURI_TYPE

public static final int ANYURI_TYPE

BASE64BINARY_TYPE

public static final int BASE64BINARY_TYPE

BOOLEAN_TYPE

public static final int BOOLEAN_TYPE

BYTE_TYPE

public static final int BYTE_TYPE

DATETIME_TYPE

public static final int DATETIME_TYPE

DATE_TYPE

public static final int DATE_TYPE

DECIMAL_TYPE

public static final int DECIMAL_TYPE

DOUBLE_TYPE

public static final int DOUBLE_TYPE

DURATION_TYPE

public static final int DURATION_TYPE

ENTITIES_TYPE

public static final int ENTITIES_TYPE

ENTITY_TYPE

public static final int ENTITY_TYPE

FLOAT_TYPE

public static final int FLOAT_TYPE

GDAY_TYPE

public static final int GDAY_TYPE

GMONTHDAY_TYPE

public static final int GMONTHDAY_TYPE

GMONTH_TYPE

public static final int GMONTH_TYPE

GYEARMONTH_TYPE

public static final int GYEARMONTH_TYPE

GYEAR_TYPE

public static final int GYEAR_TYPE

HEXBINARY_TYPE

public static final int HEXBINARY_TYPE

IDREFS_TYPE

public static final int IDREFS_TYPE

IDREF_TYPE

public static final int IDREF_TYPE

ID_TYPE

public static final int ID_TYPE

INTEGER_TYPE

public static final int INTEGER_TYPE

INT_TYPE

public static final int INT_TYPE

INVALID_TYPE

public static final int INVALID_TYPE
This code is for errors or uninitialized types.

LANGUAGE_TYPE

public static final int LANGUAGE_TYPE

LONG_TYPE

public static final int LONG_TYPE

NAME_TYPE

public static final int NAME_TYPE

NCNAME_TYPE

public static final int NCNAME_TYPE

NEGATIVE_INTEGER_TYPE

public static final int NEGATIVE_INTEGER_TYPE

NMTOKENS_TYPE

public static final int NMTOKENS_TYPE

NMTOKEN_TYPE

public static final int NMTOKEN_TYPE

NON_NEGATIVE_INTEGER_TYPE

public static final int NON_NEGATIVE_INTEGER_TYPE

NON_POSITIVE_INTEGER_TYPE

public static final int NON_POSITIVE_INTEGER_TYPE

NORMALIZEDSTRING_TYPE

public static final int NORMALIZEDSTRING_TYPE

NOTATION_TYPE

public static final int NOTATION_TYPE

POSITIVE_INTEGER_TYPE

public static final int POSITIVE_INTEGER_TYPE

QNAME_TYPE

public static final int QNAME_TYPE

RESOURCE_LOCATION

static final String RESOURCE_LOCATION
The resource location for the built-in types property files

SHORT_TYPE

public static final int SHORT_TYPE

STRING_TYPE

public static final int STRING_TYPE

TIME_TYPE

public static final int TIME_TYPE

TOKEN_TYPE

public static final int TOKEN_TYPE

TYPE_DEFINITIONS

static final String TYPE_DEFINITIONS
The resource for the Simple types

TYPE_MAPPINGS

static final String TYPE_MAPPINGS
The resource for the mapping properties

UNSIGNED_BYTE_TYPE

public static final int UNSIGNED_BYTE_TYPE

UNSIGNED_INT_TYPE

public static final int UNSIGNED_INT_TYPE

UNSIGNED_LONG_TYPE

public static final int UNSIGNED_LONG_TYPE

UNSIGNED_SHORT_TYPE

public static final int UNSIGNED_SHORT_TYPE

USER_TYPE

public static final int USER_TYPE
Simple type defined by the user

Method Detail

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 schema name the name of the SimpleType baseName the name of the SimpleType's base type derivation 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

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. 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 schema name the name of the SimpleType baseType the base type derivation the name of the derivation method (null/""/"list"/"restriction")

Returns: the new SimpleType, or null if its parent could not be found.

getBuiltInType

public SimpleType getBuiltInType(String typeName)
Gets an instance of a class derived from SimpleType representing the built in type which name is given as a parameter.

getBuiltInTypeName

public String getBuiltInTypeName(int builtInTypeCode)
Gets a built in type's name given its code.

isBuiltInType

public static boolean isBuiltInType(int codeType)
Tells if a type code corresponds to 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
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com