Package org.exolab.castor.builder.types
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
public abstract class AbstractDigitsFacet extends AbstractRangeFacet
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 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
Constructors Modifier Constructor Description protected
AbstractDigitsFacet()
No-arg constructor.protected
AbstractDigitsFacet(boolean fractionDigitsZeroOnly)
Construct a new AbstractDigitsFacet optionally allowing the fractionDigits facet to be set to all positive values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
codeDigitsFacet(JSourceCode jsc, java.lang.String validatorName)
Generate the source code for digits facet validation.int
getFractionDigits()
Returns the fractionDigits facet value of this XSType.int
getTotalDigits()
Returns the totalDigits facet value of this XSType.protected void
setDigitsFacet(Facet facet)
Transfer given facet if it is a digits facet.protected void
setFacet(Facet facet)
Set the given facet for XSType if applicable.void
setFractionDigits(int fractionDigits)
Sets the fractionDigits facet for this XSType.void
setTotalDigits(int totalDigits)
Sets the totalDigits facet for this XSType.-
Methods inherited from class org.exolab.castor.builder.types.AbstractRangeFacet
codeRangeFacet, getMaxExclusive, getMaxInclusive, getMinExclusive, getMinInclusive, hasMaximum, hasMinimum, setMaxExclusive, setMaxInclusive, setMinExclusive, setMinInclusive, setRangeFacet
-
Methods inherited from class org.exolab.castor.builder.types.AbstractWhiteSpaceFacet
codeWhiteSpaceFacet, getWhiteSpace, hasWhiteSpace, setWhiteSpace, setWhiteSpaceFacet
-
Methods inherited from class org.exolab.castor.builder.types.AbstractPatternFacet
addPattern, addPatternFacet, codePatternFacet, getPatterns
-
Methods inherited from class org.exolab.castor.builder.types.XSType
createDefaultValueWithString, createFromJavaObjectCode, createToJavaObjectCode, getJType, getName, getType, isCollection, isDateTime, isEnumerated, isPrimitive, newInstanceCode, setAsEnumerated, setFacets, validationCode
-
-
-
-
Constructor Detail
-
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 Detail
-
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
protected final void setFacet(Facet facet)
Set the given facet for XSType if applicable.- Overrides:
setFacet
in classAbstractRangeFacet
- Parameters:
facet
- The facet to set for XSType.
-
setDigitsFacet
protected final void setDigitsFacet(Facet facet)
Transfer given facet if it is a digits facet.- Parameters:
facet
- The facet to transfer.
-
codeDigitsFacet
protected final void codeDigitsFacet(JSourceCode jsc, java.lang.String validatorName)
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.
-
-