Package org.exolab.castor.builder.types
Class XSType
java.lang.Object
org.exolab.castor.builder.types.XSType
- Direct Known Subclasses:
AbstractPatternFacet,XSClass,XSListType
The base XML Schema Type class.
- Version:
- $Revision: 7943 $ $Date: 2005-03-05 06:42:06 -0700 (Sat, 05 Mar 2005) $
- Author:
- Keith Visco, Ralf Joachim
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortxsd:anyURI.static final shortxsd:base64Binary.static final shortxsd:boolean.static final shortxsd:byte.static final shortA user-defined type.static final shortA collection type.static final shortxsd:date.static final shortxsd:dateTime.static final shortxsd:decimal.static final shortxsd:double.static final shortxsd:duration.static final shortxsd:ENTITIES.static final shortxsd:ENTITY.static final shortxsd:float.static final shortxsd:gDay.static final shortxsd:gMonth.static final shortxsd:gMonthDay.static final shortxsd:gYear.static final shortxsd:gYearMonth.static final shortxsd:hexBinary.static final shortxsd:ID.static final shortxsd:IDREF.static final shortxsd:IDREFS.static final shortxsd:int.static final shortxsd:integer.static final shortxsd:language.static final shortxsd:long.static final shortxsd:name.static final shortxsd:NCNAME.static final shortxsd:negativeInteger.static final shortxsd:NMTOKEN.static final shortxsd:NMTOKENS.static final shortxsd:nonNegativeInteger.static final shortxsd:nonPositiveInteger.static final shortxsd:normalizedString.static final shortxsd:notation.static final shortValue meaning the type is unassigned.static final shortxsd:positiveInteger.static final shortxsd:QName.static final shortxsd:short.static final shortxsd:string.static final shortxsd:time.static final shortxsd:token.static final shortxsd:unsignedByte.static final shortxsd:unsignedInt.static final shortxsd:unsignedLong.static final shortxsd:unsignedShort. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultValueWithString(String variableName) Creates source code for an additional constructor that deals with default values as specified in the XML schema instance.abstract StringcreateFromJavaObjectCode(String variableName) Returns the string necessary to convert an Object to an instance of this XSType.abstract StringcreateToJavaObjectCode(String variableName) Returns the string necessary to convert an instance of this XSType to an Object.abstract JTypegetJType()Returns the JType that this XSType represents.abstract StringgetName()Returns the name of this XSType.abstract shortgetType()Returns the type of this XSType.booleanReturns true if this XSType represents a collection.abstract booleanReturns true if the XSType represents an XML Schema date/time type.final booleanReturns true if this XSType represents an enumerated type.abstract booleanReturns true if this XSType represents a primitive type.abstract StringReturns the Java code neccessary to create a new instance of the JType associated with this XSType.final voidsetAsEnumerated(boolean enumerated) Sets the enumerated flag for this XSClass.protected abstract voidSet the given facet for XSType if applicable.final voidsetFacets(SimpleType simpleType) Reads and sets the facets for XSType.abstract voidvalidationCode(JSourceCode jsc, String fixedValue, String validatorInstanceName) Creates the validation code for an instance of this XSType.
-
Field Details
-
NULL
public static final short NULLValue meaning the type is unassigned.- See Also:
-
CLASS
public static final short CLASSA user-defined type.- See Also:
-
STRING_TYPE
public static final short STRING_TYPExsd:string.- See Also:
-
DURATION_TYPE
public static final short DURATION_TYPExsd:duration.- See Also:
-
DATETIME_TYPE
public static final short DATETIME_TYPExsd:dateTime.- See Also:
-
TIME_TYPE
public static final short TIME_TYPExsd:time.- See Also:
-
DATE_TYPE
public static final short DATE_TYPExsd:date.- See Also:
-
GYEARMONTH_TYPE
public static final short GYEARMONTH_TYPExsd:gYearMonth.- See Also:
-
GYEAR_TYPE
public static final short GYEAR_TYPExsd:gYear.- See Also:
-
GMONTHDAY_TYPE
public static final short GMONTHDAY_TYPExsd:gMonthDay.- See Also:
-
GDAY_TYPE
public static final short GDAY_TYPExsd:gDay.- See Also:
-
GMONTH_TYPE
public static final short GMONTH_TYPExsd:gMonth.- See Also:
-
BOOLEAN_TYPE
public static final short BOOLEAN_TYPExsd:boolean.- See Also:
-
BASE64BINARY_TYPE
public static final short BASE64BINARY_TYPExsd:base64Binary.- See Also:
-
HEXBINARY_TYPE
public static final short HEXBINARY_TYPExsd:hexBinary.- See Also:
-
FLOAT_TYPE
public static final short FLOAT_TYPExsd:float.- See Also:
-
DOUBLE_TYPE
public static final short DOUBLE_TYPExsd:double.- See Also:
-
DECIMAL_TYPE
public static final short DECIMAL_TYPExsd:decimal.- See Also:
-
ANYURI_TYPE
public static final short ANYURI_TYPExsd:anyURI.- See Also:
-
QNAME_TYPE
public static final short QNAME_TYPExsd:QName.- See Also:
-
NOTATION_TYPE
public static final short NOTATION_TYPExsd:notation.- See Also:
-
NORMALIZEDSTRING_TYPE
public static final short NORMALIZEDSTRING_TYPExsd:normalizedString.- See Also:
-
TOKEN_TYPE
public static final short TOKEN_TYPExsd:token.- See Also:
-
LANGUAGE_TYPE
public static final short LANGUAGE_TYPExsd:language.- See Also:
-
NAME_TYPE
public static final short NAME_TYPExsd:name.- See Also:
-
NCNAME_TYPE
public static final short NCNAME_TYPExsd:NCNAME.- See Also:
-
ID_TYPE
public static final short ID_TYPExsd:ID.- See Also:
-
IDREF_TYPE
public static final short IDREF_TYPExsd:IDREF.- See Also:
-
IDREFS_TYPE
public static final short IDREFS_TYPExsd:IDREFS.- See Also:
-
ENTITY
public static final short ENTITYxsd:ENTITY.- See Also:
-
ENTITIES
public static final short ENTITIESxsd:ENTITIES.- See Also:
-
NMTOKEN_TYPE
public static final short NMTOKEN_TYPExsd:NMTOKEN.- See Also:
-
NMTOKENS_TYPE
public static final short NMTOKENS_TYPExsd:NMTOKENS.- See Also:
-
INTEGER_TYPE
public static final short INTEGER_TYPExsd:integer.- See Also:
-
NON_POSITIVE_INTEGER_TYPE
public static final short NON_POSITIVE_INTEGER_TYPExsd:nonPositiveInteger.- See Also:
-
NEGATIVE_INTEGER_TYPE
public static final short NEGATIVE_INTEGER_TYPExsd:negativeInteger.- See Also:
-
LONG_TYPE
public static final short LONG_TYPExsd:long.- See Also:
-
INT_TYPE
public static final short INT_TYPExsd:int.- See Also:
-
SHORT_TYPE
public static final short SHORT_TYPExsd:short.- See Also:
-
BYTE_TYPE
public static final short BYTE_TYPExsd:byte.- See Also:
-
NON_NEGATIVE_INTEGER_TYPE
public static final short NON_NEGATIVE_INTEGER_TYPExsd:nonNegativeInteger.- See Also:
-
POSITIVE_INTEGER_TYPE
public static final short POSITIVE_INTEGER_TYPExsd:positiveInteger.- See Also:
-
COLLECTION
public static final short COLLECTIONA collection type.- See Also:
-
UNSIGNED_LONG_TYPE
public static final short UNSIGNED_LONG_TYPExsd:unsignedLong.- See Also:
-
UNSIGNED_SHORT_TYPE
public static final short UNSIGNED_SHORT_TYPExsd:unsignedShort.- See Also:
-
UNSIGNED_BYTE_TYPE
public static final short UNSIGNED_BYTE_TYPExsd:unsignedByte.- See Also:
-
UNSIGNED_INT_TYPE
public static final short UNSIGNED_INT_TYPExsd:unsignedInt.- See Also:
-
-
Constructor Details
-
XSType
public XSType()
-
-
Method Details
-
isEnumerated
public final boolean isEnumerated()Returns true if this XSType represents an enumerated type.- Returns:
- True if this XSType represents an enumerated type.
-
setAsEnumerated
public final 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.
-
getName
Returns the name of this XSType.- Returns:
- The name of this XSType.
-
getType
public abstract short getType()Returns the type of this XSType.- Returns:
- the type of this XSType.
-
isPrimitive
public abstract boolean isPrimitive()Returns true if this XSType represents a primitive type.- Returns:
- True if this XSType represents a primitive type.
-
isDateTime
public abstract 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.
-
isCollection
public boolean isCollection()Returns true if this XSType represents a collection.- Returns:
- True if this XSType represents a collection.
-
getJType
Returns the JType that this XSType represents.- Returns:
- The JType that this XSType represents.
-
newInstanceCode
Returns the Java code neccessary to create a new instance of the JType associated with this XSType.- Returns:
- The Java code neccessary to create a new instance.
-
createToJavaObjectCode
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.
-
createFromJavaObjectCode
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.
-
createDefaultValueWithString
Creates source code for an additional constructor that deals with default values as specified in the XML schema instance.- Parameters:
variableName- Name of the constructor argument.- Returns:
- Source code for dealing with default values.
-
setFacets
Reads and sets the facets for XSType.- Parameters:
simpleType- The SimpleType containing the facets.
-
setFacet
Set the given facet for XSType if applicable.- Parameters:
facet- The facet to set for XSType.
-
validationCode
public abstract void validationCode(JSourceCode jsc, String fixedValue, String validatorInstanceName) Creates the validation code for an instance of this XSType. If necessary the validation code should create a newly configured TypeValidator, that should then be added to a FieldValidator instance whose name is provided.- Parameters:
jsc- The JSourceCode to fill in.fixedValue- A fixed value to use if any.validatorInstanceName- The name of the FieldValidator that the configured TypeValidator should be added to.
-