|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.schema.SchemaStructure com.saxonica.schema.SchemaTypeImpl com.saxonica.schema.UserSimpleType com.saxonica.schema.UserUnionType
public class UserUnionType
A class that represents the XML Schema Union simple-type.
Field Summary |
---|
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(SchemaAwareConfiguration config)
Creates a new Union type. |
Method Summary | |
---|---|
void |
addMemberTypeReference(TypeReference member)
Add a member type to the list of member types |
AtomicType |
getCommonAtomicType()
Get the most specific possible atomic type that all items in this SimpleType belong to |
List |
getMemberTypeReferences()
Get the list of member types |
SequenceIterator |
getTypedValue(CharSequence value,
NamespaceResolver resolver,
NameChecker nameChecker)
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 |
isBuiltInType()
Determine whether this is a built-in type or a user-defined 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 |
isUnionType()
Return true if this type is a union type (that is, if its variety is union) |
Iterator |
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. |
void |
serializeVariety(SchemaModelSerializer serializer)
Serialize the schema component |
void |
setMemberTypeReferences(List members)
Set the member types of this union type. |
boolean |
validate(SchemaCompiler compiler)
Validate this Union, replacing all unresolved forwards references at the same time |
ValidationFailure |
validateContent(CharSequence value,
NamespaceResolver nsResolver,
NameChecker nameChecker)
Check whether a given input string is valid according to this SimpleType |
Methods inherited from class com.saxonica.schema.UserSimpleType |
---|
addFacet, analyzeContentExpression, applyWhitespaceNormalization, atomize, checkAgainstFacets, checkTypeDerivationIsOK, convertFacetValues, elaborate, getBuiltInBaseType, getFacet, getFacetList, getFacets, getFacets, getLocalFacetList, getTypedValue, getWhitespaceAction, isSimpleType, isTypeDerivationOK, mergeEnumerationFacets, serialize, setFacetList |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
fixup, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 |
---|
getValidationStatus |
Methods inherited from interface com.saxonica.schema.UserSchemaComponent |
---|
fixup |
Constructor Detail |
---|
public UserUnionType(SchemaAwareConfiguration config)
config
- the Configuration for this Union (Cannot be null)Method Detail |
---|
public AtomicType getCommonAtomicType()
public void setMemberTypeReferences(List members)
members
- a list of TypeReference
objectspublic void addMemberTypeReference(TypeReference member)
member
- a reference to a new member typepublic List getMemberTypeReferences()
TypeReference
objectspublic Iterator iterateMemberTypeReferences()
public boolean isAtomicType()
isAtomicType
in interface SchemaType
isAtomicType
in interface SimpleType
isAtomicType
in class UserSimpleType
public boolean isBuiltInType()
public boolean isListType()
isListType
in interface SimpleType
isListType
in class UserSimpleType
public boolean isUnionType()
isUnionType
in interface SimpleType
isUnionType
in class UserSimpleType
public boolean isNamespaceSensitive()
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
validate
in class UserSimpleType
compiler
- used for error reporting
SchemaException
public void lookForCycles(Stack references, SchemaCompiler compiler) throws SchemaException, UnresolvedReferenceException
lookForCycles
in interface UserSchemaComponent
lookForCycles
in class SchemaStructure
references
- 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, NameChecker nameChecker)
value
- 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.nameChecker
- checks names for conformance to XML 1.0 or XML 1.1 rules
UnsupportedOperationException
- if the type is namespace-sensitive and no namespace
resolver is suppliedpublic SequenceIterator getTypedValue(CharSequence value, NamespaceResolver resolver, NameChecker nameChecker) throws ValidationException
SimpleType
value
- 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.nameChecker
- a NameChecker used in the case of types that are defined in terms of the
XML NCName syntax: this is used to check conformance to XML 1.0 or XML 1.1 naming rules, as
appropriate
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 typepublic void serializeVariety(SchemaModelSerializer serializer) throws XPathException
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |