org.exolab.castor.xml.schema

Class SimpleTypesFactory


public class SimpleTypesFactory
extends java.lang.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: 1.1.1.1 $ $Date: 2003/03/03 07:09:35 $
Author:
Arnaud Berry

Field Summary

static int
ANYSIMPLETYPE_TYPE
static int
ANYURI_TYPE
static int
BASE64BINARY_TYPE
static int
BOOLEAN_TYPE
static int
BYTE_TYPE
static int
DATETIME_TYPE
static int
DATE_TYPE
static int
DECIMAL_TYPE
static int
DOUBLE_TYPE
static int
DURATION_TYPE
static int
ENTITIES_TYPE
static int
ENTITY_TYPE
static int
FLOAT_TYPE
static int
GDAY_TYPE
static int
GMONTHDAY_TYPE
static int
GMONTH_TYPE
static int
GYEARMONTH_TYPE
static int
GYEAR_TYPE
static int
HEXBINARY_TYPE
static int
IDREFS_TYPE
static int
IDREF_TYPE
static int
ID_TYPE
static int
INTEGER_TYPE
static int
INT_TYPE
static int
INVALID_TYPE
This code is for errors or uninitialized types.
static int
LANGUAGE_TYPE
static int
LONG_TYPE
static int
NAME_TYPE
static int
NCNAME_TYPE
static int
NEGATIVE_INTEGER_TYPE
static int
NMTOKENS_TYPE
static int
NMTOKEN_TYPE
static int
NON_NEGATIVE_INTEGER_TYPE
static int
NON_POSITIVE_INTEGER_TYPE
static int
NORMALIZEDSTRING_TYPE
static int
NOTATION_TYPE
static int
POSITIVE_INTEGER_TYPE
static int
QNAME_TYPE
(package private) static String
RESOURCE_LOCATION
The resource location for the built-in types property files
static int
SHORT_TYPE
static int
STRING_TYPE
static int
TIME_TYPE
static int
TOKEN_TYPE
(package private) static String
TYPE_DEFINITIONS
The resource for the Simple types
(package private) static String
TYPE_MAPPINGS
The resource for the mapping properties
static int
UNSIGNED_BYTE_TYPE
static int
UNSIGNED_INT_TYPE
static int
UNSIGNED_LONG_TYPE
static int
UNSIGNED_SHORT_TYPE
static int
USER_TYPE
Simple type defined by the user

Method Summary

(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.
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.
String
getBuiltInTypeName(int builtInTypeCode)
Gets a built in type's name given its code.
static boolean
isBuiltInType(int codeType)
Tells if a type code corresponds to an xml schema built in type
static boolean
isPrimitiveType(int codeType)
Tells if a type code corresponds to an xml schema (built in) primitive type

Field Details

ANYSIMPLETYPE_TYPE

public static final int ANYSIMPLETYPE_TYPE
Field Value:
100

ANYURI_TYPE

public static final int ANYURI_TYPE
Field Value:
17

BASE64BINARY_TYPE

public static final int BASE64BINARY_TYPE
Field Value:
12

BOOLEAN_TYPE

public static final int BOOLEAN_TYPE
Field Value:
11

BYTE_TYPE

public static final int BYTE_TYPE
Field Value:
38

DATETIME_TYPE

public static final int DATETIME_TYPE
Field Value:
3

DATE_TYPE

public static final int DATE_TYPE
Field Value:
5

DECIMAL_TYPE

public static final int DECIMAL_TYPE
Field Value:
16

DOUBLE_TYPE

public static final int DOUBLE_TYPE
Field Value:
15

DURATION_TYPE

public static final int DURATION_TYPE
Field Value:
2

ENTITIES_TYPE

public static final int ENTITIES_TYPE
Field Value:
29

ENTITY_TYPE

public static final int ENTITY_TYPE
Field Value:
28

FLOAT_TYPE

public static final int FLOAT_TYPE
Field Value:
14

GDAY_TYPE

public static final int GDAY_TYPE
Field Value:
9

GMONTHDAY_TYPE

public static final int GMONTHDAY_TYPE
Field Value:
8

GMONTH_TYPE

public static final int GMONTH_TYPE
Field Value:
10

GYEARMONTH_TYPE

public static final int GYEARMONTH_TYPE
Field Value:
6

GYEAR_TYPE

public static final int GYEAR_TYPE
Field Value:
7

HEXBINARY_TYPE

public static final int HEXBINARY_TYPE
Field Value:
13

IDREFS_TYPE

public static final int IDREFS_TYPE
Field Value:
27

IDREF_TYPE

public static final int IDREF_TYPE
Field Value:
26

ID_TYPE

public static final int ID_TYPE
Field Value:
25

INTEGER_TYPE

public static final int INTEGER_TYPE
Field Value:
32

INT_TYPE

public static final int INT_TYPE
Field Value:
36

INVALID_TYPE

public static final int INVALID_TYPE
This code is for errors or uninitialized types.
Field Value:
-1

LANGUAGE_TYPE

public static final int LANGUAGE_TYPE
Field Value:
22

LONG_TYPE

public static final int LONG_TYPE
Field Value:
35

NAME_TYPE

public static final int NAME_TYPE
Field Value:
23

NCNAME_TYPE

public static final int NCNAME_TYPE
Field Value:
24

NEGATIVE_INTEGER_TYPE

public static final int NEGATIVE_INTEGER_TYPE
Field Value:
34

NMTOKENS_TYPE

public static final int NMTOKENS_TYPE
Field Value:
31

NMTOKEN_TYPE

public static final int NMTOKEN_TYPE
Field Value:
30

NON_NEGATIVE_INTEGER_TYPE

public static final int NON_NEGATIVE_INTEGER_TYPE
Field Value:
39

NON_POSITIVE_INTEGER_TYPE

public static final int NON_POSITIVE_INTEGER_TYPE
Field Value:
33

NORMALIZEDSTRING_TYPE

public static final int NORMALIZEDSTRING_TYPE
Field Value:
20

NOTATION_TYPE

public static final int NOTATION_TYPE
Field Value:
19

POSITIVE_INTEGER_TYPE

public static final int POSITIVE_INTEGER_TYPE
Field Value:
44

QNAME_TYPE

public static final int QNAME_TYPE
Field Value:
18

RESOURCE_LOCATION

(package private) static final String RESOURCE_LOCATION
The resource location for the built-in types property files

SHORT_TYPE

public static final int SHORT_TYPE
Field Value:
37

STRING_TYPE

public static final int STRING_TYPE
Field Value:
1

TIME_TYPE

public static final int TIME_TYPE
Field Value:
4

TOKEN_TYPE

public static final int TOKEN_TYPE
Field Value:
21

TYPE_DEFINITIONS

(package private) static final String TYPE_DEFINITIONS
The resource for the Simple types

TYPE_MAPPINGS

(package private) static final String TYPE_MAPPINGS
The resource for the mapping properties

UNSIGNED_BYTE_TYPE

public static final int UNSIGNED_BYTE_TYPE
Field Value:
43

UNSIGNED_INT_TYPE

public static final int UNSIGNED_INT_TYPE
Field Value:
41

UNSIGNED_LONG_TYPE

public static final int UNSIGNED_LONG_TYPE
Field Value:
40

UNSIGNED_SHORT_TYPE

public static final int UNSIGNED_SHORT_TYPE
Field Value:
42

USER_TYPE

public static final int USER_TYPE
Simple type defined by the user
Field Value:
0

Method Details

createUserSimpleType

(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 (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

(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. 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-2003. All rights reserved http://www.intalio.com