org.exolab.castor.builder.types
Class XSType

java.lang.Object
  extended by org.exolab.castor.builder.types.XSType
Direct Known Subclasses:
XSAnyURI, XSBinary, XSBoolean, XSClass, XSDate, XSDateTime, XSDecimal, XSDuration, XSGDay, XSGMonth, XSGMonthDay, XSGYear, XSGYearMonth, XSId, XSIdRef, XSList, XSNCName, XSNMToken, XSPatternBase, XSTime

public abstract class XSType
extends java.lang.Object

The base XML Schema Type class

Version:
$Revision: 1.6 $ $Date: 2005/03/05 13:41:44 $
Author:
Keith Visco

Field Summary
static java.lang.String ANYURI_NAME
          the name of the anyURI type.
static short ANYURI_TYPE
           
static java.lang.String BASE64BINARY_NAME
          The name of the base64Binary type
static short BASE64BINARY_TYPE
           
static java.lang.String BOOLEAN_NAME
          The name of the boolean type
static short BOOLEAN_TYPE
           
static java.lang.String BYTE_NAME
          The name of the byte type
static short BYTE_TYPE
           
static short CLASS
           
static short COLLECTION
           
static java.lang.String DATE_NAME
          The name of the date type
static short DATE_TYPE
           
static java.lang.String DATETIME_NAME
          The name of the the dateTime type
static short DATETIME_TYPE
           
static java.lang.String DECIMAL_NAME
          The name of the decimal type
static short DECIMAL_TYPE
           
static java.lang.String DOUBLE_NAME
          The name of the double type
static short DOUBLE_TYPE
           
static java.lang.String DURATION_NAME
          the name of the duration type
static short DURATION_TYPE
           
static short ENTITIES
           
static short ENTITY
           
static java.lang.String FLOAT_NAME
          The name of the float type
static short FLOAT_TYPE
           
static java.lang.String GDAY_NAME
          The name of the gDay type.
static short GDAY_TYPE
           
static java.lang.String GMONTH_NAME
          The name of the gMonth type.
static short GMONTH_TYPE
           
static java.lang.String GMONTHDAY_NAME
          The name of the gMonthDay type.
static short GMONTHDAY_TYPE
           
static java.lang.String GYEAR_NAME
          The name of the gYear type.
static short GYEAR_TYPE
           
static java.lang.String GYEARMONTH_NAME
          The name of the gYearMonth type.
static short GYEARMONTH_TYPE
           
static java.lang.String HEXBINARY_NAME
          The name of the hexBinary type
static short HEXBINARY_TYPE
           
static java.lang.String ID_NAME
          The name of the ID type
static short ID_TYPE
           
static java.lang.String IDREF_NAME
          The name of the IDREF type
static short IDREF_TYPE
           
static java.lang.String IDREFS_NAME
          The Name of the IDREFS type
static short IDREFS_TYPE
           
static java.lang.String INT_NAME
          The name of the int type
static short INT_TYPE
           
static java.lang.String INTEGER_NAME
          The name of the integer type
static short INTEGER_TYPE
           
static java.lang.String LANGUAGE_NAME
          The name of the language type.
static short LANGUAGE_TYPE
           
static java.lang.String LONG_NAME
          The name of the long type
static short LONG_TYPE
           
static java.lang.String NAME_NAME
          The name of the Name type
static short NAME_TYPE
           
static java.lang.String NCNAME_NAME
          The name of the NCName type
static short NCNAME_TYPE
           
static java.lang.String NEGATIVE_INTEGER_NAME
          The name of the negative-integer type
static short NEGATIVE_INTEGER_TYPE
           
static java.lang.String NMTOKEN_NAME
          The name of the NMTOKEN type
static short NMTOKEN_TYPE
           
static java.lang.String NMTOKENS_NAME
          The of the NMTOKENS type
static short NMTOKENS_TYPE
           
static java.lang.String NON_NEGATIVE_INTEGER_NAME
          The name of the non-positive-integer type
static short NON_NEGATIVE_INTEGER_TYPE
           
static java.lang.String NON_POSITIVE_INTEGER_NAME
          The name of the non-positive-integer type
static short NON_POSITIVE_INTEGER_TYPE
           
static java.lang.String NORMALIZEDSTRING_NAME
          The name of the normalizedString type.
static short NORMALIZEDSTRING_TYPE
           
static java.lang.String NOTATION_NAME
          the name of the notation type
static short NOTATION_TYPE
           
static short NULL
           
static java.lang.String POSITIVE_INTEGER_NAME
          The name of the positive-integer type
static short POSITIVE_INTEGER_TYPE
           
static java.lang.String QNAME_NAME
          the name of the QName type
static short QNAME_TYPE
           
static java.lang.String SHORT_NAME
          The name of the short type
static short SHORT_TYPE
           
static java.lang.String STRING_NAME
          The name of the string type
static short STRING_TYPE
           
static java.lang.String TIME_NAME
          the name of the time type
static short TIME_TYPE
           
static java.lang.String TOKEN_NAME
          The name of the token type
static short TOKEN_TYPE
           
 
Constructor Summary
protected XSType(short type)
          Creates a new XSType of the given type
 
Method Summary
 java.lang.String createFromJavaObjectCode(java.lang.String variableName)
          Returns the String necessary to convert an Object to an instance of this XSType.
 java.lang.String createToJavaObjectCode(java.lang.String variableName)
          Returns the String necessary to convert an instance of this XSType to an Object.
protected static java.lang.String escapePattern(java.lang.String str)
          Escapes special characters in the given String so that it can be printed correctly.
protected static java.util.Enumeration getFacets(SimpleType simpleType)
          Returns a list of Facets from the simpleType (duplicate facets due to extension are filtered out)
abstract  JType getJType()
          Returns the JType that this XSType represents
 java.lang.String getName()
          Returns the name of this XSType
 short getType()
          Returns the type of this XSType
 boolean isDateTime()
          Returns true if the XSType represents an XML Schema date/time type
 boolean isEnumerated()
          Returns true if this XSType represents an enumerated type
 boolean isPrimitive()
           
 java.lang.String newInstanceCode()
          Returns the Java code neccessary to create a new instance of the JType associated with this XSType
 void setAsEnumerated(boolean enumerated)
          Sets the enumerated flag for this XSClass
abstract  void setFacets(SimpleType simpleType)
          Reads and sets the facets for XSType
abstract  void validationCode(JSourceCode jsc, java.lang.String fixedValue, java.lang.String fieldValidatorInstanceName)
          Creates the validation code for an instance of this XSType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING_NAME

public static final java.lang.String STRING_NAME
The name of the string type

See Also:
Constant Field Values

BOOLEAN_NAME

public static final java.lang.String BOOLEAN_NAME
The name of the boolean type

See Also:
Constant Field Values

FLOAT_NAME

public static final java.lang.String FLOAT_NAME
The name of the float type

See Also:
Constant Field Values

DOUBLE_NAME

public static final java.lang.String DOUBLE_NAME
The name of the double type

See Also:
Constant Field Values

DECIMAL_NAME

public static final java.lang.String DECIMAL_NAME
The name of the decimal type

See Also:
Constant Field Values

DURATION_NAME

public static final java.lang.String DURATION_NAME
the name of the duration type

See Also:
Constant Field Values

DATETIME_NAME

public static final java.lang.String DATETIME_NAME
The name of the the dateTime type

See Also:
Constant Field Values

TIME_NAME

public static final java.lang.String TIME_NAME
the name of the time type

See Also:
Constant Field Values

DATE_NAME

public static final java.lang.String DATE_NAME
The name of the date type

See Also:
Constant Field Values

GYEARMONTH_NAME

public static final java.lang.String GYEARMONTH_NAME
The name of the gYearMonth type.

See Also:
Constant Field Values

GYEAR_NAME

public static final java.lang.String GYEAR_NAME
The name of the gYear type.

See Also:
Constant Field Values

GMONTHDAY_NAME

public static final java.lang.String GMONTHDAY_NAME
The name of the gMonthDay type.

See Also:
Constant Field Values

GDAY_NAME

public static final java.lang.String GDAY_NAME
The name of the gDay type.

See Also:
Constant Field Values

GMONTH_NAME

public static final java.lang.String GMONTH_NAME
The name of the gMonth type.

See Also:
Constant Field Values

HEXBINARY_NAME

public static final java.lang.String HEXBINARY_NAME
The name of the hexBinary type

See Also:
Constant Field Values

BASE64BINARY_NAME

public static final java.lang.String BASE64BINARY_NAME
The name of the base64Binary type

See Also:
Constant Field Values

ANYURI_NAME

public static final java.lang.String ANYURI_NAME
the name of the anyURI type.

See Also:
Constant Field Values

QNAME_NAME

public static final java.lang.String QNAME_NAME
the name of the QName type

See Also:
Constant Field Values

NOTATION_NAME

public static final java.lang.String NOTATION_NAME
the name of the notation type

See Also:
Constant Field Values

NORMALIZEDSTRING_NAME

public static final java.lang.String NORMALIZEDSTRING_NAME
The name of the normalizedString type.

See Also:
Constant Field Values

TOKEN_NAME

public static final java.lang.String TOKEN_NAME
The name of the token type

See Also:
Constant Field Values

LANGUAGE_NAME

public static final java.lang.String LANGUAGE_NAME
The name of the language type.

See Also:
Constant Field Values

IDREFS_NAME

public static final java.lang.String IDREFS_NAME
The Name of the IDREFS type

See Also:
Constant Field Values

NMTOKEN_NAME

public static final java.lang.String NMTOKEN_NAME
The name of the NMTOKEN type

See Also:
Constant Field Values

NMTOKENS_NAME

public static java.lang.String NMTOKENS_NAME
The of the NMTOKENS type


NAME_NAME

public static final java.lang.String NAME_NAME
The name of the Name type

See Also:
Constant Field Values

NCNAME_NAME

public static final java.lang.String NCNAME_NAME
The name of the NCName type

See Also:
Constant Field Values

ID_NAME

public static final java.lang.String ID_NAME
The name of the ID type

See Also:
Constant Field Values

IDREF_NAME

public static final java.lang.String IDREF_NAME
The name of the IDREF type

See Also:
Constant Field Values

INTEGER_NAME

public static final java.lang.String INTEGER_NAME
The name of the integer type

See Also:
Constant Field Values

NON_NEGATIVE_INTEGER_NAME

public static final java.lang.String NON_NEGATIVE_INTEGER_NAME
The name of the non-positive-integer type

See Also:
Constant Field Values

NON_POSITIVE_INTEGER_NAME

public static final java.lang.String NON_POSITIVE_INTEGER_NAME
The name of the non-positive-integer type

See Also:
Constant Field Values

NEGATIVE_INTEGER_NAME

public static final java.lang.String NEGATIVE_INTEGER_NAME
The name of the negative-integer type

See Also:
Constant Field Values

LONG_NAME

public static final java.lang.String LONG_NAME
The name of the long type

See Also:
Constant Field Values

INT_NAME

public static final java.lang.String INT_NAME
The name of the int type

See Also:
Constant Field Values

SHORT_NAME

public static final java.lang.String SHORT_NAME
The name of the short type

See Also:
Constant Field Values

BYTE_NAME

public static final java.lang.String BYTE_NAME
The name of the byte type

See Also:
Constant Field Values

POSITIVE_INTEGER_NAME

public static final java.lang.String POSITIVE_INTEGER_NAME
The name of the positive-integer type

See Also:
Constant Field Values

NULL

public static final short NULL
See Also:
Constant Field Values

CLASS

public static final short CLASS
See Also:
Constant Field Values

STRING_TYPE

public static final short STRING_TYPE
See Also:
Constant Field Values

DURATION_TYPE

public static final short DURATION_TYPE
See Also:
Constant Field Values

DATETIME_TYPE

public static final short DATETIME_TYPE
See Also:
Constant Field Values

TIME_TYPE

public static final short TIME_TYPE
See Also:
Constant Field Values

DATE_TYPE

public static final short DATE_TYPE
See Also:
Constant Field Values

GYEARMONTH_TYPE

public static final short GYEARMONTH_TYPE
See Also:
Constant Field Values

GYEAR_TYPE

public static final short GYEAR_TYPE
See Also:
Constant Field Values

GMONTHDAY_TYPE

public static final short GMONTHDAY_TYPE
See Also:
Constant Field Values

GDAY_TYPE

public static final short GDAY_TYPE
See Also:
Constant Field Values

GMONTH_TYPE

public static final short GMONTH_TYPE
See Also:
Constant Field Values

BOOLEAN_TYPE

public static final short BOOLEAN_TYPE
See Also:
Constant Field Values

BASE64BINARY_TYPE

public static final short BASE64BINARY_TYPE
See Also:
Constant Field Values

HEXBINARY_TYPE

public static final short HEXBINARY_TYPE
See Also:
Constant Field Values

FLOAT_TYPE

public static final short FLOAT_TYPE
See Also:
Constant Field Values

DOUBLE_TYPE

public static final short DOUBLE_TYPE
See Also:
Constant Field Values

DECIMAL_TYPE

public static final short DECIMAL_TYPE
See Also:
Constant Field Values

ANYURI_TYPE

public static final short ANYURI_TYPE
See Also:
Constant Field Values

QNAME_TYPE

public static final short QNAME_TYPE
See Also:
Constant Field Values

NOTATION_TYPE

public static final short NOTATION_TYPE
See Also:
Constant Field Values

NORMALIZEDSTRING_TYPE

public static final short NORMALIZEDSTRING_TYPE
See Also:
Constant Field Values

TOKEN_TYPE

public static final short TOKEN_TYPE
See Also:
Constant Field Values

LANGUAGE_TYPE

public static final short LANGUAGE_TYPE
See Also:
Constant Field Values

NAME_TYPE

public static final short NAME_TYPE
See Also:
Constant Field Values

NCNAME_TYPE

public static final short NCNAME_TYPE
See Also:
Constant Field Values

ID_TYPE

public static final short ID_TYPE
See Also:
Constant Field Values

IDREF_TYPE

public static final short IDREF_TYPE
See Also:
Constant Field Values

IDREFS_TYPE

public static final short IDREFS_TYPE
See Also:
Constant Field Values

ENTITY

public static final short ENTITY
See Also:
Constant Field Values

ENTITIES

public static final short ENTITIES
See Also:
Constant Field Values

NMTOKEN_TYPE

public static final short NMTOKEN_TYPE
See Also:
Constant Field Values

NMTOKENS_TYPE

public static final short NMTOKENS_TYPE
See Also:
Constant Field Values

INTEGER_TYPE

public static final short INTEGER_TYPE
See Also:
Constant Field Values

NON_POSITIVE_INTEGER_TYPE

public static final short NON_POSITIVE_INTEGER_TYPE
See Also:
Constant Field Values

NEGATIVE_INTEGER_TYPE

public static final short NEGATIVE_INTEGER_TYPE
See Also:
Constant Field Values

LONG_TYPE

public static final short LONG_TYPE
See Also:
Constant Field Values

INT_TYPE

public static final short INT_TYPE
See Also:
Constant Field Values

SHORT_TYPE

public static final short SHORT_TYPE
See Also:
Constant Field Values

BYTE_TYPE

public static final short BYTE_TYPE
See Also:
Constant Field Values

NON_NEGATIVE_INTEGER_TYPE

public static final short NON_NEGATIVE_INTEGER_TYPE
See Also:
Constant Field Values

POSITIVE_INTEGER_TYPE

public static final short POSITIVE_INTEGER_TYPE
See Also:
Constant Field Values

COLLECTION

public static final short COLLECTION
See Also:
Constant Field Values
Constructor Detail

XSType

protected XSType(short type)
Creates a new XSType of the given type

Method Detail

getJType

public abstract JType getJType()
Returns the JType that this XSType represents

Returns:
the JType that this XSType represents

setFacets

public abstract void setFacets(SimpleType simpleType)
Reads and sets the facets for XSType

Parameters:
simpleType - the SimpleType containing the facets

getType

public short getType()
Returns the type of this XSType

Returns:
the type of this XSType

getFacets

protected static java.util.Enumeration getFacets(SimpleType simpleType)
Returns a list of Facets from the simpleType (duplicate facets due to extension are filtered out)

Parameters:
simpleType - the Simpletype we want the facets for
Returns:
Unique list of facets from the simple type

createToJavaObjectCode

public java.lang.String createToJavaObjectCode(java.lang.String variableName)
Returns the String necessary to convert an instance of this XSType to an Object. This method is really only useful for primitive types

Parameters:
variableName - the name of the instance variable
Returns:
the String necessary to convert an instance of this XSType to an Object

newInstanceCode

public java.lang.String newInstanceCode()
Returns the Java code neccessary to create a new instance of the JType associated with this XSType


createFromJavaObjectCode

public java.lang.String createFromJavaObjectCode(java.lang.String variableName)
Returns the String necessary to convert an Object to an instance of this XSType. This method is really only useful for primitive types

Parameters:
variableName - the name of the Object
Returns:
the String necessary to convert an Object to an instance of this XSType

isEnumerated

public boolean isEnumerated()
Returns true if this XSType represents an enumerated type

Returns:
true if this XSType represents an enumerated type

isPrimitive

public boolean isPrimitive()

isDateTime

public boolean isDateTime()
Returns true if the XSType represents an XML Schema date/time type

Returns:
true if the XSType represents an XML Schema date/time type

getName

public java.lang.String getName()
Returns the name of this XSType

Returns:
the name of this XSType

setAsEnumerated

public void setAsEnumerated(boolean enumerated)
Sets the enumerated flag for this XSClass

Parameters:
enumerated - a boolean indicating whether or not this XSClass represents an enumerated type

validationCode

public abstract void validationCode(JSourceCode jsc,
                                    java.lang.String fixedValue,
                                    java.lang.String fieldValidatorInstanceName)
Creates the validation code for an instance of this XSType. The validation code should if necessary create a newly configured TypeValidator, that should then be added to a FieldValidator instance whose name is provided.

Parameters:
fixedValue - a fixed value to use if any
jsc - the JSourceCode to fill in.
fieldValidatorInstanceName - the name of the FieldValidator that the configured TypeValidator should be added to.

escapePattern

protected static java.lang.String escapePattern(java.lang.String str)
Escapes special characters in the given String so that it can be printed correctly.

Parameters:
str - the String to escape
Returns:
the escaped String, or null if the given String was null.


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com