Class AbstractDigitsFacet
java.lang.Object
org.exolab.castor.builder.types.XSType
org.exolab.castor.builder.types.AbstractPatternFacet
org.exolab.castor.builder.types.AbstractWhiteSpaceFacet
org.exolab.castor.builder.types.AbstractRangeFacet
org.exolab.castor.builder.types.AbstractDigitsFacet
- Direct Known Subclasses:
XSByte, XSDecimal, XSInt, XSInteger, XSLong, XSNegativeInteger, XSNonNegativeInteger, XSNonPositiveInteger, XSPositiveInteger, XSShort, XSUnsignedByte, XSUnsignedInt, XSUnsignedLong, XSUnsignedShort
A base class for types which support the digits, range, whiteSpace and pattern facets.
- Since:
- 1.1
- Version:
- $Revision: 6662 $ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
- Author:
- Ralf Joachim
-
Field Summary
Fields inherited from class 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_TYPEModifier 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
ConstructorsModifierConstructorDescriptionprotectedNo-arg constructor.protectedAbstractDigitsFacet(boolean fractionDigitsZeroOnly) Construct a new AbstractDigitsFacet optionally allowing the fractionDigits facet to be set to all positive values. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidcodeDigitsFacet(JSourceCode jsc, String validatorName) Generate the source code for digits facet validation.final intReturns the fractionDigits facet value of this XSType.final intReturns the totalDigits facet value of this XSType.protected final voidsetDigitsFacet(Facet facet) Transfer given facet if it is a digits facet.protected final voidSet the given facet for XSType if applicable.final voidsetFractionDigits(int fractionDigits) Sets the fractionDigits facet for this XSType.final voidsetTotalDigits(int totalDigits) Sets the totalDigits facet for this XSType.Methods inherited from class AbstractRangeFacet
codeRangeFacet, getMaxExclusive, getMaxInclusive, getMinExclusive, getMinInclusive, getNegativeInfinity, getPositiveInfinity, hasMaximum, hasMinimum, hasNegavtiveInfinity, hasPositiveInfinity, setMaxExclusive, setMaxInclusive, setMinExclusive, setMinInclusive, setNegativeInfinity, setPositiveInfinity, setRangeFacetModifier and TypeMethodDescriptionprotected final voidcodeRangeFacet(JSourceCode jsc, String validatorName) Generate the source code for pattern facet validation.final StringReturns the maximum exclusive value that this XSDate can hold.final StringReturns the maximum inclusive value that this XSDate can hold.final StringReturns the minimum exclusive value that this XSDate can hold.final StringReturns the minimum inclusive value that this XSDate can hold.final Stringfinal Stringfinal booleanReturns true if a maximum (inclusive or exclusive) has been set.final booleanReturns true if a minimum (inclusive or exclusive) has been set.final booleanfinal booleanfinal voidsetMaxExclusive(String max) Sets the maximum exclusive value that this XSDate can hold.final voidsetMaxInclusive(String max) Sets the maximum inclusive value that this XSDate can hold.final voidsetMinExclusive(String min) Sets the minimum exclusive value that this XSDate can hold.final voidsetMinInclusive(String min) Sets the minimum inclusive value that this XSDate can hold.final voidsetNegativeInfinity(String negativeInfity) final voidsetPositiveInfinity(String positiveInfity) protected final voidsetRangeFacet(Facet facet) Transfer given facet if it is a range.Methods inherited from class AbstractWhiteSpaceFacet
codeWhiteSpaceFacet, getWhiteSpace, hasWhiteSpace, setWhiteSpace, setWhiteSpaceFacetModifier and TypeMethodDescriptionprotected final voidcodeWhiteSpaceFacet(JSourceCode jsc, String validatorName) Generate the source code for pattern facet validation.final StringReturns the whiteSpace facet of this type.final booleanReturns true if the whiteSpace facet is used.final voidsetWhiteSpace(String value) Sets the whiteSpace facet of this XSType.protected final voidsetWhiteSpaceFacet(Facet facet) Transfer given facet if it is a whiteSpace.Methods inherited from class AbstractPatternFacet
addPattern, addPatternFacet, codePatternFacet, getPatternsModifier and TypeMethodDescriptionfinal voidaddPattern(String pattern) Adds a pattern branch for this XSType.protected final voidaddPatternFacet(Facet facet) Transfer given facet if it is a pattern.protected final voidcodePatternFacet(JSourceCode jsc, String validatorName) Generate the source code for pattern facet validation.Get list of pattern facets.Methods inherited from class XSType
createDefaultValueWithString, createFromJavaObjectCode, createToJavaObjectCode, getJType, getName, getType, isCollection, isDateTime, isEnumerated, isPrimitive, newInstanceCode, setAsEnumerated, setFacets, validationCodeModifier 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.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.
-
Constructor Details
-
AbstractDigitsFacet
protected AbstractDigitsFacet()No-arg constructor. By default only '0' is supported for the fractionDigits facet. -
AbstractDigitsFacet
protected AbstractDigitsFacet(boolean fractionDigitsZeroOnly) Construct a new AbstractDigitsFacet optionally allowing the fractionDigits facet to be set to all positive values.- Parameters:
fractionDigitsZeroOnly- If set to true only '0' is allowed for the fractionDigits facet. If set to false all positive values are allowed for fractionDigits facet.
-
-
Method Details
-
getTotalDigits
public final int getTotalDigits()Returns the totalDigits facet value of this XSType.- Returns:
- The totalDigits facet value of this XSType.
-
setTotalDigits
public final void setTotalDigits(int totalDigits) Sets the totalDigits facet for this XSType.- Parameters:
totalDigits- The value of totalDigits (must be >0).
-
getFractionDigits
public final int getFractionDigits()Returns the fractionDigits facet value of this XSType.- Returns:
- The fractionDigits facet value of this XSType.
-
setFractionDigits
public final void setFractionDigits(int fractionDigits) Sets the fractionDigits facet for this XSType.- Parameters:
fractionDigits- The value of fractionDigits (must be >=0).
-
setFacet
Set the given facet for XSType if applicable.- Overrides:
setFacetin classAbstractRangeFacet- Parameters:
facet- The facet to set for XSType.
-
setDigitsFacet
Transfer given facet if it is a digits facet.- Parameters:
facet- The facet to transfer.
-
codeDigitsFacet
Generate the source code for digits facet validation.- Parameters:
jsc- The JSourceCode to fill in.validatorName- The name of the TypeValidator that the digits should be added to.
-