com.saxonica.schema
Class DigitsFacet

java.lang.Object
  extended by com.saxonica.schema.Facet
      extended by com.saxonica.schema.DigitsFacet
All Implemented Interfaces:
Serializable

public class DigitsFacet
extends Facet

Represents either of the facets totalDigits or fractionDigits

See Also:
Serialized Form

Field Summary
static int FRACTION_DIGITS
          Constant identifying the fractionDigits facet
static int TOTAL_DIGITS
          Constant identifying the totalDigits facet
 
Fields inherited from class com.saxonica.schema.Facet
ENUMERATION, FRACTIONDIGITS, LENGTH, MAX_EXCLUSIVE, MAX_INCLUSIVE, MAX_LENGTH, MIN_EXCLUSIVE, MIN_INCLUSIVE, MIN_LENGTH, PATTERN, TOTALDIGITS, WHITESPACE
 
Constructor Summary
DigitsFacet(int facetType)
          Construct a totalDigits or fractionDigits facet.
 
Method Summary
 void checkFacetRestriction(UserSimpleType type, SimpleType base)
          Check that this facet is legal when used on a type derived by restriction
 String getName()
          Get the name of this facet
 String getValue()
          Get the value of this facet as a string
 void setValue(String value)
          Set the value of this facet.
 boolean testAtomicValue(AtomicValue value)
          Test whether an atomic value conforms to this facet
 
Methods inherited from class com.saxonica.schema.Facet
appliesToWholeList, getWhitespaceAction, isFacetName, isFixed, isNewlyIntroduced, makeFacet, serializeFacet, setFixed, testLength, toLong
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOTAL_DIGITS

public static final int TOTAL_DIGITS
Constant identifying the totalDigits facet

See Also:
Constant Field Values

FRACTION_DIGITS

public static final int FRACTION_DIGITS
Constant identifying the fractionDigits facet

See Also:
Constant Field Values
Constructor Detail

DigitsFacet

public DigitsFacet(int facetType)
Construct a totalDigits or fractionDigits facet. For internal use only.

Parameters:
facetType - indicates which facet to construct. One of TOTAL_DIGITS or FRACTION_DIGITS
Method Detail

getName

public String getName()
Get the name of this facet

Overrides:
getName in class Facet
Returns:
either "totalDigits" or "fractionDigits"

getValue

public String getValue()
Get the value of this facet as a string

Overrides:
getValue in class Facet
Returns:
the value of this facet as a string

setValue

public void setValue(String value)
              throws SchemaException
Set the value of this facet. For internal use only.

Overrides:
setValue in class Facet
Parameters:
value - the value of the facet. This must be a string that parses as an integer.
Throws:
SchemaException - if the value is invalid (not an integer)

checkFacetRestriction

public void checkFacetRestriction(UserSimpleType type,
                                  SimpleType base)
                           throws SchemaException,
                                  ValidationException
Check that this facet is legal when used on a type derived by restriction

Overrides:
checkFacetRestriction in class Facet
Parameters:
base - the type from which the restricted type is derived
type - the type on which the facet is defined
Throws:
SchemaException - if the facet is not allowed for this simple type, or if the combination of facets is inconsistent with values defined on the base type.
ValidationException

testAtomicValue

public boolean testAtomicValue(AtomicValue value)
Test whether an atomic value conforms to this facet

Overrides:
testAtomicValue in class Facet
Parameters:
value - the value to be tested
Returns:
true if the value conforms; false if it doesn't conform


Copyright (C) Michael H. Kay. All rights reserved.