public class ValueConstraint
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ValueConstraint.Variety |
Constructor and Description |
---|
ValueConstraint(ValueConstraint.Variety variety,
java.lang.String 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
|
java.lang.Comparable |
getComparisonKey()
Get a comparison key that can be used for comparing values
|
java.lang.String |
getLexicalForm()
Returns the lexical form of the value
|
AtomicSequence |
getValue()
Gets the value as a typed value.
|
ValueConstraint.Variety |
getVariety()
Get the variety of the constraint (fixed or default)
|
void |
serialize(SchemaModelSerializer serializer)
Serialize the value constraint
|
boolean |
testFixedValue(Configuration config,
java.lang.CharSequence 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, java.lang.String lexicalForm)
public ValueConstraint.Variety getVariety()
public java.lang.String getLexicalForm()
public AtomicSequence getValue()
public java.lang.Comparable getComparisonKey()
public Sequence asFunction()
public boolean testFixedValue(Configuration config, java.lang.CharSequence 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-2020 Saxonica Limited. All rights reserved.