|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.saxonica.schema.SchemaStructure
com.saxonica.schema.UserDefinedType
com.saxonica.schema.UserSimpleType
com.saxonica.schema.UserUnionType
public class UserUnionType
A class that represents the XML Schema simple-type with variety union.
A "plain" union is a union that is not derived by restriction and whose
member types are all either atomic types or plain union types. Only plain union
types can be named in the XPath SequenceType production. (All union types, however,
can act as the target of a cast expression). This class implements the interface
PlainType despite the fact that not all its instances represent plain
unions; to test whether a union is a plain union, use the isPlainType()
method.
| Field Summary |
|---|
| Fields inherited from class com.saxonica.schema.UserDefinedType |
|---|
extendedTypes, finalProhibitions |
| Fields inherited from interface net.sf.saxon.type.SimpleType |
|---|
VARIETY_ATOMIC, VARIETY_LIST, VARIETY_UNION, VARIETY_UNSPECIFIED_SIMPLE |
| Fields inherited from interface net.sf.saxon.type.SchemaType |
|---|
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION |
| Fields inherited from interface net.sf.saxon.type.SchemaComponent |
|---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
| Constructor Summary | |
|---|---|
UserUnionType(EnterpriseConfiguration config)
Creates a new Union type. |
|
| Method Summary | |
|---|---|
void |
addMemberTypeReference(TypeReference member)
Add a member type to the list of member types |
void |
elaborate(SchemaCompiler compiler)
Elaborate the schema component: after reloading a serialized schema component model, this expands the component with derived information needed during validation episodes. |
PlainType |
getAtomizedItemType()
Get the item type of the atomic values that will be produced when an item of this type is atomized |
double |
getDefaultPriority()
Determine the default priority of this item type when used on its own as a Pattern |
List<TypeReference> |
getMemberTypeReferences()
Get the list of member types |
Set<PlainType> |
getPlainMemberTypes()
Get the set of atomic types that are subsumed by this type |
ItemType |
getPrimitiveItemType()
Method defined in ItemType: get a primitive supertype in the ItemType type hierarchy |
int |
getPrimitiveType()
Method defined in ItemType: get a primitive supertype in the ItemType type hierarchy |
ItemType |
getSuperType(TypeHierarchy th)
Method defined in ItemType: get a supertype in the ItemType type hierarchy |
SequenceIterator<AtomicValue> |
getTypedValue(CharSequence value,
NamespaceResolver resolver,
ConversionRules rules)
Get the typed value corresponding to a given string value, assuming it is valid against this type |
boolean |
isAtomicType()
Test whether this Simple Type is an atomic type |
boolean |
isAtomizable()
Ask whether values of this type are atomizable |
boolean |
isBuiltInType()
Determine whether this is a built-in type or a user-defined type |
boolean |
isIdRefType()
Ask whether this type is an IDREF or IDREFS type. |
boolean |
isIdType()
Ask whether this type is an ID type. |
boolean |
isListType()
Determine whether this is a list type |
boolean |
isNamespaceSensitive()
Test whether this type is namespace sensitive, that is, if a namespace context is needed to translate between the lexical space and the value space. |
boolean |
isPlainType()
Ask whether this Union type is a "plain type", defined as a union type whose member types are all atomic types or plain unions. |
boolean |
isUnionType()
Return true if this type is a union type (that is, if its variety is union) |
Iterator<TypeReference> |
iterateMemberTypeReferences()
Returns an Iterator over all the SimpleTypes that are members of a union type. |
void |
lookForCycles(Stack references,
SchemaCompiler compiler)
This method is called to look for cycles. |
boolean |
matches(Item item,
XPathContext context)
Test whether a given item conforms to this type |
boolean |
matchesItem(Item item,
boolean allowURIPromotion,
Configuration config)
Test whether a given item conforms to this type |
void |
serializeVariety(SchemaModelSerializer serializer)
Serialize the schema component |
void |
setMemberTypeReferences(List<TypeReference> members)
Set the member types of this union type. |
String |
toString()
|
String |
toString(NamePool pool)
Produce a representation of this type name for use in error messages. |
boolean |
validate(SchemaCompiler compiler)
Validate this Union, replacing all unresolved forwards references at the same time |
ValidationFailure |
validateContent(CharSequence value,
NamespaceResolver nsResolver,
ConversionRules rules)
Check whether a given input string is valid according to this SimpleType |
void |
visitNamedSchemaComponents(SchemaComponentVisitor visitor)
Visit all the schema components used in this ItemType definition |
| Methods inherited from class com.saxonica.schema.UserSimpleType |
|---|
addFacet, addInheritedFacets, analyzeContentExpression, applyWhitespaceNormalization, atomize, checkAgainstFacets, checkTypeDerivationIsOK, convertFacetValues, getBuiltInBaseType, getExtendedFacetList, getFacet, getFacets, getLocalFacetList, getTypedValue, getWhitespaceAction, isSimpleType, isTypeDerivationOK, mergeEnumerationFacets, postprocess, preprocess, serialize, setFacetList |
| Methods inherited from class com.saxonica.schema.SchemaStructure |
|---|
fixup, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.saxon.type.PlainType |
|---|
isExternalType |
| Methods inherited from interface net.sf.saxon.type.SimpleType |
|---|
isExternalType |
| Methods inherited from interface net.sf.saxon.type.SchemaType |
|---|
allowsDerivation, getBaseType, getBlock, getDerivationMethod, getDescription, getDisplayName, getFingerprint, getName, getNameCode, getSystemId, getTargetNamespace, isAnonymousType, isComplexType, isSameType |
| Methods inherited from interface net.sf.saxon.type.SchemaComponent |
|---|
getRedefinitionLevel, getValidationStatus |
| Methods inherited from interface com.saxonica.schema.UserSchemaComponent |
|---|
fixup |
| Constructor Detail |
|---|
public UserUnionType(EnterpriseConfiguration config)
config - the Configuration for this Union (Cannot be null)| Method Detail |
|---|
public void setMemberTypeReferences(List<TypeReference> members)
members - a list of TypeReference objectspublic void addMemberTypeReference(TypeReference member)
member - a reference to a new member typepublic List<TypeReference> getMemberTypeReferences()
TypeReference objectspublic Iterator<TypeReference> iterateMemberTypeReferences()
public boolean isAtomicType()
isAtomicType in interface ItemTypeisAtomicType in interface SchemaTypeisAtomicType in interface SimpleTypeisAtomicType in class UserSimpleTypepublic boolean isPlainType()
isPlainType in interface ItemTypepublic boolean isIdType()
isIdType in interface SchemaTypeisIdType in class UserSimpleTypepublic boolean isIdRefType()
isIdRefType in interface SchemaTypeisIdRefType in class UserSimpleTypepublic boolean isBuiltInType()
isBuiltInType in interface SimpleTypepublic boolean isListType()
isListType in interface SimpleTypeisListType in class UserSimpleTypepublic boolean isUnionType()
isUnionType in interface SimpleTypeisUnionType in class UserSimpleTypepublic boolean isNamespaceSensitive()
isNamespaceSensitive in interface SimpleType
public boolean validate(SchemaCompiler compiler)
throws SchemaException
validate in interface UserSchemaComponentvalidate in class UserSimpleTypecompiler - used for error reporting
SchemaException
public void elaborate(SchemaCompiler compiler)
throws SchemaException
UserSimpleType
elaborate in interface UserSchemaComponentelaborate in class UserSimpleTypecompiler - the schema compiler
SchemaException - if a fatal error occurs
public void lookForCycles(Stack references,
SchemaCompiler compiler)
throws SchemaException,
UnresolvedReferenceException
lookForCycles in interface UserSchemaComponentlookForCycles in class SchemaStructurereferences - A list of objects that contain direct or indirect references
to this object, and that must therefore not be referred to from this object.compiler - used for error reporting
SchemaException
UnresolvedReferenceException
public ValidationFailure validateContent(CharSequence value,
NamespaceResolver nsResolver,
ConversionRules rules)
validateContent in interface SimpleTypevalue - the input string to be checkednsResolver - a namespace resolver used to resolve namespace prefixes if the type
is namespace sensitive. The value supplied may be null; in this case any namespace-sensitive
content will throw an UnsupportedOperationException.rules - the configuration-wide conversion rules
UnsupportedOperationException - if the type is namespace-sensitive and no namespace
resolver is supplied
public SequenceIterator<AtomicValue> getTypedValue(CharSequence value,
NamespaceResolver resolver,
ConversionRules rules)
throws ValidationException
SimpleType
getTypedValue in interface SimpleTypevalue - the string valueresolver - a namespace resolver used to resolve any namespace prefixes appearing
in the content of values. Can supply null, in which case any namespace-sensitive content
will be rejected.rules - the conversion rules from the configuration
AtomicValue,
The next() method on the iterator throws no checked exceptions, although it is not actually
declared as an UnfailingIterator.
ValidationException - if the supplied value is not in the lexical space of the data type
public void serializeVariety(SchemaModelSerializer serializer)
throws XPathException
serializeVariety in class UserSimpleTypeXPathException
public boolean matches(Item item,
XPathContext context)
matches in interface ItemTypeitem - The item to be testedcontext - the XPath dynamic evaluation context
public boolean matchesItem(Item item,
boolean allowURIPromotion,
Configuration config)
ItemType
matchesItem in interface ItemTypeitem - The item to be testedallowURIPromotion - if a URI value is to be treated as a stringconfig - the Saxon configuration
public ItemType getSuperType(TypeHierarchy th)
getSuperType in interface ItemTypeth - the type hierarchy cache
public ItemType getPrimitiveItemType()
getPrimitiveItemType in interface ItemTypepublic int getPrimitiveType()
getPrimitiveType in interface ItemTypepublic String toString(NamePool pool)
ItemType
toString in interface ItemTypepool - the name pool
public PlainType getAtomizedItemType()
ItemType
getAtomizedItemType in interface ItemTypepublic boolean isAtomizable()
ItemType
isAtomizable in interface ItemType
public void visitNamedSchemaComponents(SchemaComponentVisitor visitor)
throws XPathException
ItemType
visitNamedSchemaComponents in interface ItemTypevisitor - the visitor class to be called when each component is visited
XPathException - if an error occurspublic Set<PlainType> getPlainMemberTypes()
getPlainMemberTypes in interface PlainTypepublic double getDefaultPriority()
ItemType
getDefaultPriority in interface ItemTypepublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||