org.exolab.castor.builder.types

Class XSType

public abstract class XSType extends Object

The base XML Schema Type class

Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:01 $

Author: Keith Visco

Field Summary
static StringANYURI_NAME
the name of the anyURI type.
static shortANYURI_TYPE
static StringBASE64BINARY_NAME
The name of the base64Binary type
static shortBASE64BINARY_TYPE
static StringBOOLEAN_NAME
The name of the boolean type
static shortBOOLEAN_TYPE
static StringBYTE_NAME
The name of the byte type
static shortBYTE_TYPE
static shortCLASS
static shortCOLLECTION
static StringDATETIME_NAME
The name of the the dateTime type
static shortDATETIME_TYPE
static StringDATE_NAME
The name of the date type
static shortDATE_TYPE
static StringDECIMAL_NAME
The name of the decimal type
static shortDECIMAL_TYPE
static StringDOUBLE_NAME
The name of the double type
static shortDOUBLE_TYPE
static StringDURATION_NAME
the name of the duration type
static shortDURATION_TYPE
static shortENTITIES
static shortENTITY
static StringFLOAT_NAME
The name of the float type
static shortFLOAT_TYPE
static StringGDAY_NAME
The name of the gDay type.
static shortGDAY_TYPE
static StringGMONTHDAY_NAME
The name of the gMonthDay type.
static shortGMONTHDAY_TYPE
static StringGMONTH_NAME
The name of the gMonth type.
static shortGMONTH_TYPE
static StringGYEARMONTH_NAME
The name of the gYearMonth type.
static shortGYEARMONTH_TYPE
static StringGYEAR_NAME
The name of the gYear type.
static shortGYEAR_TYPE
static StringHEXBINARY_NAME
The name of the hexBinary type
static shortHEXBINARY_TYPE
static StringIDREFS_NAME
The Name of the IDREFS type
static shortIDREFS_TYPE
static StringIDREF_NAME
The name of the IDREF type
static shortIDREF_TYPE
static StringID_NAME
The name of the ID type
static shortID_TYPE
static StringINTEGER_NAME
The name of the integer type
static shortINTEGER_TYPE
static StringINT_NAME
The name of the int type
static shortINT_TYPE
static StringLANGUAGE_NAME
The name of the language type.
static shortLANGUAGE_TYPE
static StringLONG_NAME
The name of the long type
static shortLONG_TYPE
static StringNAME_NAME
The name of the Name type
static shortNAME_TYPE
static StringNCNAME_NAME
The name of the NCName type
static shortNCNAME_TYPE
static StringNEGATIVE_INTEGER_NAME
The name of the negative-integer type
static shortNEGATIVE_INTEGER_TYPE
static StringNMTOKENS_NAME
The of the NMTOKENS type
static shortNMTOKENS_TYPE
static StringNMTOKEN_NAME
The name of the NMTOKEN type
static shortNMTOKEN_TYPE
static StringNON_NEGATIVE_INTEGER_NAME
The name of the non-positive-integer type
static shortNON_NEGATIVE_INTEGER_TYPE
static StringNON_POSITIVE_INTEGER_NAME
The name of the non-positive-integer type
static shortNON_POSITIVE_INTEGER_TYPE
static StringNORMALIZEDSTRING_NAME
The name of the normalizedString type.
static shortNORMALIZEDSTRING_TYPE
static StringNOTATION_NAME
the name of the notation type
static shortNOTATION_TYPE
static shortNULL
static StringPOSITIVE_INTEGER_NAME
The name of the positive-integer type
static shortPOSITIVE_INTEGER_TYPE
static StringQNAME_NAME
the name of the QName type
static shortQNAME_TYPE
static StringSHORT_NAME
The name of the short type
static shortSHORT_TYPE
static StringSTRING_NAME
The name of the string type
static shortSTRING_TYPE
static StringTIME_NAME
the name of the time type
static shortTIME_TYPE
static StringTOKEN_NAME
The name of the token type
static shortTOKEN_TYPE
Constructor Summary
protected XSType(short type)
Creates a new XSType of the given type
Method Summary
StringcreateFromJavaObjectCode(String variableName)
Returns the String necessary to convert an Object to an instance of this XSType.
StringcreateToJavaObjectCode(String variableName)
Returns the String necessary to convert an instance of this XSType to an Object.
protected static StringescapePattern(String str)
Escapes special characters in the given String so that it can be printed correctly.
protected static EnumerationgetFacets(SimpleType simpleType)
Returns a list of Facets from the simpleType (duplicate facets due to extension are filtered out)
abstract JTypegetJType()
Returns the JType that this XSType represents
StringgetName()
Returns the name of this XSType
shortgetType()
Returns the type of this XSType
booleanisDateTime()
Returns true if the XSType represents an XML Schema date/time type
booleanisEnumerated()
Returns true if this XSType represents an enumerated type
booleanisPrimitive()
StringnewInstanceCode()
Returns the Java code neccessary to create a new instance of the JType associated with this XSType
voidsetAsEnumertated(boolean enumerated)
Sets the enumerated flag for this XSClass
abstract voidsetFacets(SimpleType simpleType)
Reads and sets the facets for XSType
abstract voidvalidationCode(JSourceCode jsc, String fixedValue, String fieldValidatorInstanceName)
Creates the validation code for an instance of this XSType.

Field Detail

ANYURI_NAME

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

ANYURI_TYPE

public static final short ANYURI_TYPE

BASE64BINARY_NAME

public static final String BASE64BINARY_NAME
The name of the base64Binary type

BASE64BINARY_TYPE

public static final short BASE64BINARY_TYPE

BOOLEAN_NAME

public static final String BOOLEAN_NAME
The name of the boolean type

BOOLEAN_TYPE

public static final short BOOLEAN_TYPE

BYTE_NAME

public static final String BYTE_NAME
The name of the byte type

BYTE_TYPE

public static final short BYTE_TYPE

CLASS

public static final short CLASS

COLLECTION

public static final short COLLECTION

DATETIME_NAME

public static final String DATETIME_NAME
The name of the the dateTime type

DATETIME_TYPE

public static final short DATETIME_TYPE

DATE_NAME

public static final String DATE_NAME
The name of the date type

DATE_TYPE

public static final short DATE_TYPE

DECIMAL_NAME

public static final String DECIMAL_NAME
The name of the decimal type

DECIMAL_TYPE

public static final short DECIMAL_TYPE

DOUBLE_NAME

public static final String DOUBLE_NAME
The name of the double type

DOUBLE_TYPE

public static final short DOUBLE_TYPE

DURATION_NAME

public static final String DURATION_NAME
the name of the duration type

DURATION_TYPE

public static final short DURATION_TYPE

ENTITIES

public static final short ENTITIES

ENTITY

public static final short ENTITY

FLOAT_NAME

public static final String FLOAT_NAME
The name of the float type

FLOAT_TYPE

public static final short FLOAT_TYPE

GDAY_NAME

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

GDAY_TYPE

public static final short GDAY_TYPE

GMONTHDAY_NAME

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

GMONTHDAY_TYPE

public static final short GMONTHDAY_TYPE

GMONTH_NAME

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

GMONTH_TYPE

public static final short GMONTH_TYPE

GYEARMONTH_NAME

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

GYEARMONTH_TYPE

public static final short GYEARMONTH_TYPE

GYEAR_NAME

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

GYEAR_TYPE

public static final short GYEAR_TYPE

HEXBINARY_NAME

public static final String HEXBINARY_NAME
The name of the hexBinary type

HEXBINARY_TYPE

public static final short HEXBINARY_TYPE

IDREFS_NAME

public static final String IDREFS_NAME
The Name of the IDREFS type

IDREFS_TYPE

public static final short IDREFS_TYPE

IDREF_NAME

public static final String IDREF_NAME
The name of the IDREF type

IDREF_TYPE

public static final short IDREF_TYPE

ID_NAME

public static final String ID_NAME
The name of the ID type

ID_TYPE

public static final short ID_TYPE

INTEGER_NAME

public static final String INTEGER_NAME
The name of the integer type

INTEGER_TYPE

public static final short INTEGER_TYPE

INT_NAME

public static final String INT_NAME
The name of the int type

INT_TYPE

public static final short INT_TYPE

LANGUAGE_NAME

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

LANGUAGE_TYPE

public static final short LANGUAGE_TYPE

LONG_NAME

public static final String LONG_NAME
The name of the long type

LONG_TYPE

public static final short LONG_TYPE

NAME_NAME

public static final String NAME_NAME
The name of the Name type

NAME_TYPE

public static final short NAME_TYPE

NCNAME_NAME

public static final String NCNAME_NAME
The name of the NCName type

NCNAME_TYPE

public static final short NCNAME_TYPE

NEGATIVE_INTEGER_NAME

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

NEGATIVE_INTEGER_TYPE

public static final short NEGATIVE_INTEGER_TYPE

NMTOKENS_NAME

public static String NMTOKENS_NAME
The of the NMTOKENS type

NMTOKENS_TYPE

public static final short NMTOKENS_TYPE

NMTOKEN_NAME

public static final String NMTOKEN_NAME
The name of the NMTOKEN type

NMTOKEN_TYPE

public static final short NMTOKEN_TYPE

NON_NEGATIVE_INTEGER_NAME

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

NON_NEGATIVE_INTEGER_TYPE

public static final short NON_NEGATIVE_INTEGER_TYPE

NON_POSITIVE_INTEGER_NAME

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

NON_POSITIVE_INTEGER_TYPE

public static final short NON_POSITIVE_INTEGER_TYPE

NORMALIZEDSTRING_NAME

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

NORMALIZEDSTRING_TYPE

public static final short NORMALIZEDSTRING_TYPE

NOTATION_NAME

public static final String NOTATION_NAME
the name of the notation type

NOTATION_TYPE

public static final short NOTATION_TYPE

NULL

public static final short NULL

POSITIVE_INTEGER_NAME

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

POSITIVE_INTEGER_TYPE

public static final short POSITIVE_INTEGER_TYPE

QNAME_NAME

public static final String QNAME_NAME
the name of the QName type

QNAME_TYPE

public static final short QNAME_TYPE

SHORT_NAME

public static final String SHORT_NAME
The name of the short type

SHORT_TYPE

public static final short SHORT_TYPE

STRING_NAME

public static final String STRING_NAME
The name of the string type

STRING_TYPE

public static final short STRING_TYPE

TIME_NAME

public static final String TIME_NAME
the name of the time type

TIME_TYPE

public static final short TIME_TYPE

TOKEN_NAME

public static final String TOKEN_NAME
The name of the token type

TOKEN_TYPE

public static final short TOKEN_TYPE

Constructor Detail

XSType

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

Method Detail

createFromJavaObjectCode

public String createFromJavaObjectCode(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

createToJavaObjectCode

public String createToJavaObjectCode(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

escapePattern

protected static String escapePattern(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.

getFacets

protected static 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

getJType

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

Returns: the JType that this XSType represents

getName

public String getName()
Returns the name of this XSType

Returns: the name of this XSType

getType

public short getType()
Returns the type of this XSType

Returns: the type of this XSType

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

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

newInstanceCode

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

setAsEnumertated

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

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

setFacets

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

Parameters: simpleType the SimpleType containing the facets

validationCode

public abstract void validationCode(JSourceCode jsc, String fixedValue, 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.

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