Package org.exolab.castor.builder.types
Class XSUnsignedByte
The xsd:unsignedByte XML Schema type.
- Version:
- $Revision: 5951 $ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
- Author:
- Werner Guttmann, Ralf Joachim
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA constant holding the maximum value an xsd:unsignedByte can have, 255.static final StringA constant holding the minimum value an xsd:unsignedByte can have, 0.static final StringName of this XSType.static final shortType number of this XSType.Fields inherited from class org.exolab.castor.builder.types.XSType
ANYURI_TYPE, BASE64BINARY_TYPE, BOOLEAN_TYPE, BYTE_TYPE, CLASS, COLLECTION, DATE_TYPE, DATETIME_TYPE, DECIMAL_TYPE, DOUBLE_TYPE, DURATION_TYPE, ENTITIES, ENTITY, FLOAT_TYPE, GDAY_TYPE, GMONTH_TYPE, GMONTHDAY_TYPE, GYEAR_TYPE, GYEARMONTH_TYPE, HEXBINARY_TYPE, ID_TYPE, IDREF_TYPE, IDREFS_TYPE, INT_TYPE, INTEGER_TYPE, LANGUAGE_TYPE, LONG_TYPE, NAME_TYPE, NCNAME_TYPE, NEGATIVE_INTEGER_TYPE, NMTOKEN_TYPE, NMTOKENS_TYPE, NON_NEGATIVE_INTEGER_TYPE, NON_POSITIVE_INTEGER_TYPE, NORMALIZEDSTRING_TYPE, NOTATION_TYPE, NULL, POSITIVE_INTEGER_TYPE, QNAME_TYPE, SHORT_TYPE, STRING_TYPE, TIME_TYPE, TOKEN_TYPE, UNSIGNED_BYTE_TYPE, UNSIGNED_INT_TYPE, UNSIGNED_LONG_TYPE, UNSIGNED_SHORT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionNo-arg constructor.XSUnsignedByte(boolean asWrapper) Constructs a new XSUnsignedByte. -
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.createFromJavaObjectCode(String variableName) Returns the string necessary to convert an Object to an instance of this XSType.createToJavaObjectCode(String variableName) Returns the string necessary to convert an instance of this XSType to an Object.getJType()Returns the JType that this XSType represents.getName()Returns the name of this XSType.shortgetType()Returns the type of this XSType.booleanReturns true if the XSType represents an XML Schema date/time type.booleanReturns true if this XSType represents a primitive type.Returns the Java code neccessary to create a new instance of the JType associated with this XSType.voidvalidationCode(JSourceCode jsc, String fixedValue, String validatorInstanceName) Creates the validation code for an instance of this XSType.Methods inherited from class org.exolab.castor.builder.types.AbstractDigitsFacet
codeDigitsFacet, getFractionDigits, getTotalDigits, setDigitsFacet, setFacet, setFractionDigits, setTotalDigitsMethods inherited from class org.exolab.castor.builder.types.AbstractRangeFacet
codeRangeFacet, getMaxExclusive, getMaxInclusive, getMinExclusive, getMinInclusive, hasMaximum, hasMinimum, setMaxExclusive, setMaxInclusive, setMinExclusive, setMinInclusive, setRangeFacetMethods inherited from class org.exolab.castor.builder.types.AbstractWhiteSpaceFacet
codeWhiteSpaceFacet, getWhiteSpace, hasWhiteSpace, setWhiteSpace, setWhiteSpaceFacetMethods inherited from class org.exolab.castor.builder.types.AbstractPatternFacet
addPattern, addPatternFacet, codePatternFacet, getPatternsMethods inherited from class org.exolab.castor.builder.types.XSType
isCollection, isEnumerated, setAsEnumerated, setFacets
-
Field Details
-
NAME
Name of this XSType.- See Also:
-
TYPE
public static final short TYPEType number of this XSType.- See Also:
-
MIN_VALUE
A constant holding the minimum value an xsd:unsignedByte can have, 0.- See Also:
-
MAX_VALUE
A constant holding the maximum value an xsd:unsignedByte can have, 255.- See Also:
-
-
Constructor Details
-
XSUnsignedByte
public XSUnsignedByte()No-arg constructor. -
XSUnsignedByte
public XSUnsignedByte(boolean asWrapper) Constructs a new XSUnsignedByte.- Parameters:
asWrapper- if true, use the java.lang wrapper class.
-
-
Method Details
-
getName
Returns the name of this XSType. -
getType
public short getType()Returns the type of this XSType. -
isPrimitive
public boolean isPrimitive()Returns true if this XSType represents a primitive type.- Specified by:
isPrimitivein classXSType- Returns:
- True if this XSType represents a primitive type.
-
isDateTime
public boolean isDateTime()Returns true if the XSType represents an XML Schema date/time type.- Specified by:
isDateTimein classXSType- Returns:
- True if the XSType represents an XML Schema date/time type.
-
getJType
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.- Specified by:
newInstanceCodein classXSType- Returns:
- The Java code neccessary to create a new instance.
-
createDefaultValueWithString
Creates source code for an additional constructor that deals with default values as specified in the XML schema instance.- Overrides:
createDefaultValueWithStringin classXSType- Parameters:
variableName- Name of the constructor argument.- Returns:
- Source code for dealing with default values.
-
createToJavaObjectCode
Returns the string necessary to convert an instance of this XSType to an Object. This method is really only useful for primitive types.- Specified by:
createToJavaObjectCodein classXSType- 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.- Specified by:
createFromJavaObjectCodein classXSType- Parameters:
variableName- The name of the Object.- Returns:
- The String necessary to convert an Object to an instance of this XSType.
-
validationCode
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.- Specified by:
validationCodein classXSType- 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.
-