Class SimpleTypesFactory

java.lang.Object
org.exolab.castor.xml.schema.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: 8145 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Author:
Arnaud Berry
  • Field Details

  • 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

      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.
      Parameters:
      typeName - Name of the simple type.
      Returns:
      The SimpleType instance for the type name.
    • getBuiltInTypeName

      public String getBuiltInTypeName(int builtInTypeCode)
      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 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.