Package com.saxonica.ee.schema
Class PreprocessFacet
java.lang.Object
com.saxonica.ee.schema.Facet
com.saxonica.ee.schema.PreprocessFacet
Represents the preprocess facet on a schema-defined simple type. This is a pre-lexical facet
defined as a Saxon extension to XML Schema 1.1: it allows an XPath expression to be used to convert
the value as written (after whitespace normalization) to a different form, which is then validated
using the constraining facets. For example the preprocessing action translate($value, ',', '.') allows
the input value 3,14159 to be converted to 3.14159 which then validates as a double.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckFacetRestriction(UserSimpleType type, SimpleType base, SchemaCompiler compiler) Check that this facet is legal when used on a type derived by restrictionGet the XPath expression representing the action performed by this facet, represented as an Assertion objectGet a function item that represents this Facet schema component.getName()Returns the name of this FacetGet the XPath expression representing the reverse action performed by this facet, represented as an Assertion objectgetValue()Returns the lexical representation of this facetbooleanAsk whether this is a constraining facet (as distinct from a pre-lexical facet)postprocess(UnicodeString input) Apply the postprocessing defined by this facetpreprocess(UnicodeString input) Apply the preprocessing defined by this facetvoidserializeFacet(SchemaModelSerializer serializer) Serialize this facet when externalizing the schema component modelvoidSet the XPath expression representing the action performed by this facet, represented as an Assertion objectvoidsetReverseAction(Assertion action) Set the XPath expression representing the reverse action performed by this facet, represented as an Assertion objectbooleantestAtomicValue(AtomicValue value) Test whether an atomic value conforms to this facetMethods inherited from class com.saxonica.ee.schema.Facet
getConstraintName, getMessage, getWhitespaceAction, isFacetName, isFixed, isNewlyIntroduced, makeFacet, setFixed, setMessage, testLength, testListValue, toLong
-
Constructor Details
-
PreprocessFacet
public PreprocessFacet() -
PreprocessFacet
-
-
Method Details
-
isConstraining
public boolean isConstraining()Ask whether this is a constraining facet (as distinct from a pre-lexical facet)- Overrides:
isConstrainingin classFacet- Returns:
- true if this is a constraining facet
-
getName
Description copied from class:FacetReturns the name of this Facet -
getValue
Returns the lexical representation of this facet -
getAction
Get the XPath expression representing the action performed by this facet, represented as an Assertion object -
getReverseAction
Get the XPath expression representing the reverse action performed by this facet, represented as an Assertion object -
setAction
Set the XPath expression representing the action performed by this facet, represented as an Assertion object -
setReverseAction
Set the XPath expression representing the reverse action performed by this facet, represented as an Assertion object -
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:
checkFacetRestrictionin 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 legalValidationException- if a value is found that does not conform to the facet
-
preprocess
Apply the preprocessing defined by this facet- Parameters:
input- the lexical value, after whitespace normalization, to be converted- Returns:
- the value after preprocessing using the XPath expression defined in this facet
- Throws:
ValidationException
-
postprocess
Apply the postprocessing defined by this facet- Parameters:
input- the lexical value to be converted- Returns:
- the value after postprocessing using the reverse XPath expression defined in this facet
- Throws:
ValidationException
-
testAtomicValue
Test whether an atomic value conforms to this facet- Specified by:
testAtomicValuein classFacet- Parameters:
value- the value to be tested- Returns:
- true if the value conforms; false if it doesn't conform, or if the test fails
-
serializeFacet
Description copied from class:FacetSerialize this facet when externalizing the schema component model- Overrides:
serializeFacetin classFacet- Parameters:
serializer- receives the content for serialization- Throws:
XPathException- if an error occurs writing the value to the output
-
getFacetAsFunctionItem
Description copied from class:FacetGet a function item that represents this Facet schema component.- Specified by:
getFacetAsFunctionItemin classFacet
-