Package com.saxonica.ee.schema
Class DigitsFacet
java.lang.Object
com.saxonica.ee.schema.Facet
com.saxonica.ee.schema.DigitsFacet
- Direct Known Subclasses:
FractionDigitsFacet
,TotalDigitsFacet
Represents either of the facets totalDigits or fractionDigits
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkFacetRestriction
(UserSimpleType type, SimpleType base, SchemaCompiler compiler) Check that this facet is legal when used on a type derived by restrictionGet a function item that represents this Facet schema component.int
Get the value of this facet as an integer (used for integer facets such as minLength or totalDigits)getValue()
Get the value of this facet as a stringvoid
setNumericValue
(int value) Set the value of this facet as an integer (used for integer facets such as minLength or totalDigits)abstract void
Set the value of this facet as a stringboolean
testAtomicValue
(AtomicValue value) Test whether an atomic value conforms to this facetMethods inherited from class com.saxonica.ee.schema.Facet
getConstraintName, getMessage, getName, getWhitespaceAction, isConstraining, isFacetName, isFixed, isNewlyIntroduced, makeFacet, serializeFacet, setFixed, setMessage, testLength, testListValue, toLong
-
Constructor Details
-
Method Details
-
setValue
Set the value of this facet as a string- Parameters:
value
- the string value of the facet- Throws:
SchemaException
- if the value is invalid
-
getValue
Get the value of this facet as a string -
getNumericValue
public int getNumericValue()Get the value of this facet as an integer (used for integer facets such as minLength or totalDigits)- Returns:
- the value of the facet expressed as an integer
-
setNumericValue
public void setNumericValue(int value) Set the value of this facet as an integer (used for integer facets such as minLength or totalDigits)- Parameters:
value
- the value, as an integer
-
checkFacetRestriction
public void checkFacetRestriction(UserSimpleType type, SimpleType base, SchemaCompiler compiler) throws SchemaException, ValidationException Check that this facet is legal when used on a type derived by restriction- Overrides:
checkFacetRestriction
in classFacet
- Parameters:
type
- the type on which the facet is definedbase
- the type from which the restricted type is derivedcompiler
- the schema compiler- 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
- if a value is found that does not conform to the facet
-
testAtomicValue
Test whether an atomic value conforms to this facet- Specified by:
testAtomicValue
in classFacet
- Parameters:
value
- the value to be tested- Returns:
- true if the value conforms; false if it doesn't conform
-
getFacetAsFunctionItem
Description copied from class:Facet
Get a function item that represents this Facet schema component.- Specified by:
getFacetAsFunctionItem
in classFacet
-