Class 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
  • 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

      protected final void setFacet(Facet facet)
      Set the given facet for XSType if applicable.
      Overrides:
      setFacet in class AbstractRangeFacet
      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, 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.