public class ValueConstraint
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ValueConstraint.Variety |
Constructor and Description |
---|
ValueConstraint(ValueConstraint.Variety variety,
UnicodeString lexicalForm)
Constructor; supplies the lexical form of the value as a string.
|
Modifier and Type | Method and Description |
---|---|
Sequence |
asFunction()
For use with the saxon:schema extension function, return the value constraint in the form
of a function
|
UnicodeString |
getLexicalForm()
Returns the lexical form of the value
|
AtomicSequence |
getValue()
Gets the value of the constraint as a typed value.
|
ValueConstraint.Variety |
getVariety()
Get the variety of the constraint (fixed or default)
|
boolean |
matches(AtomicSequence supplied)
Test whether a suplied value matches the constraint
|
void |
serialize(SchemaModelSerializer serializer)
Serialize the value constraint
|
boolean |
testFixedValue(Configuration config,
UnicodeString value,
SimpleType type,
NamespaceResolver resolver)
Test that the actual value of an element or attribute conforms to the required fixed value
|
public ValueConstraint(ValueConstraint.Variety variety, UnicodeString lexicalForm)
setValue(net.sf.saxon.om.AtomicSequence)
must be called to supply the typed valuepublic ValueConstraint.Variety getVariety()
public UnicodeString getLexicalForm()
public AtomicSequence getValue()
public boolean matches(AtomicSequence supplied)
public Sequence asFunction()
public boolean testFixedValue(Configuration config, UnicodeString value, SimpleType type, NamespaceResolver resolver) throws ValidationException
config
- the Saxon configurationvalue
- the actual valuetype
- the required typeresolver
- a namespace resolver, in case QNames are involvedValidationException
- if the value is not valid as an instance of the typepublic void serialize(SchemaModelSerializer serializer) throws XPathException
XPathException
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.