|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.schema.Facet
public abstract class Facet
Represents an XML Schema Facet. Most facets are represented by subclasses of this class, the only exception is whiteSpace.
Field Summary | |
---|---|
static String |
ENUMERATION
|
static String |
FRACTIONDIGITS
|
static String |
LENGTH
|
static String |
MAX_EXCLUSIVE
|
static String |
MAX_INCLUSIVE
|
static String |
MAX_LENGTH
|
static String |
MIN_EXCLUSIVE
|
static String |
MIN_INCLUSIVE
|
static String |
MIN_LENGTH
|
static String |
PATTERN
|
static String |
TOTALDIGITS
|
static String |
WHITESPACE
|
Constructor Summary | |
---|---|
Facet()
|
Method Summary | |
---|---|
boolean |
appliesToWholeList()
Test whether this is a facet that can be used to test the normalized value of a list type. |
void |
checkFacetRestriction(UserSimpleType type,
SimpleType base)
Check that this facet is legal when used on a type derived by restriction |
String |
getName()
Returns the name of this Facet |
String |
getValue()
Returns the character (String) representation of this facet |
int |
getWhitespaceAction()
Get the whitespace action required by this facet: one of PRESERVE, REPLACE, or COLLAPSE. |
static boolean |
isFacetName(String name)
Test whether a given string is one of the recognized facet names |
boolean |
isFixed()
Test if the facet is defined in the schema with fixed="true" |
boolean |
isNewlyIntroduced(SimpleType base)
Test whether this facet is newly introduced on this type, that is, whether it is absent from the base type |
static Facet |
makeFacet(String name,
String value,
SchemaAwareConfiguration config,
NamespaceResolver resolver)
Factory method: creates a new Facet with the given name |
void |
serializeFacet(SchemaModelSerializer serializer)
Serialize this facet |
void |
setFixed(boolean fixed)
Set whether the facet is defined as fixed |
void |
setValue(String value)
Set the string value of the facet |
boolean |
testAtomicValue(AtomicValue value)
Test whether an atomic value conforms to this facet |
boolean |
testLength(int count)
Test whether the length of a list conforms to this facet. |
long |
toLong()
Returns the numeric value of this facet |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ENUMERATION
public static final String LENGTH
public static final String PATTERN
public static final String MAX_EXCLUSIVE
public static final String MAX_INCLUSIVE
public static final String MIN_EXCLUSIVE
public static final String MIN_INCLUSIVE
public static final String MAX_LENGTH
public static final String MIN_LENGTH
public static final String WHITESPACE
public static final String TOTALDIGITS
public static final String FRACTIONDIGITS
Constructor Detail |
---|
public Facet()
Method Detail |
---|
public boolean isFixed()
public void setValue(String value) throws SchemaException
value
- the string value of the facet
SchemaException
public void setFixed(boolean fixed)
fixed
- true if the facet is fixedpublic String getName()
public String getValue()
public long toLong() throws NumberFormatException
NumberFormatException
public void checkFacetRestriction(UserSimpleType type, SimpleType base) throws SchemaException, ValidationException
type
- the type on which the facet is definedbase
- the type from which the restricted type is derived
SchemaException
- if the facet is not legal
ValidationException
public boolean isNewlyIntroduced(SimpleType base)
base
- the base type
public boolean appliesToWholeList()
public boolean testAtomicValue(AtomicValue value)
value
- the value to be tested
public boolean testLength(int count)
count
- the actual length of the list
public int getWhitespaceAction()
public void serializeFacet(SchemaModelSerializer serializer) throws XPathException
serializer
- receives the content for serialization
XPathException
public static boolean isFacetName(String name)
name
- a candidate facet name, for example "totalDigits"
public static Facet makeFacet(String name, String value, SchemaAwareConfiguration config, NamespaceResolver resolver) throws SchemaException
name
- the name of the Facetvalue
- the value of the Facetconfig
- the Saxon configurationresolver
- a namespace resolver used for resolving prefixes in namespace-sensitive enumeration values
SchemaException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |