|
|||||||
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.SchemaTypeImpl
com.saxonica.schema.UserSimpleType
com.saxonica.sdoc.SimpleTypeDefinition
public class SimpleTypeDefinition
A simple type definition holds all the information about a simpleType during the course of schema processing. On completion of schema processing, more specific objects are created, for example ListType, AtomicType, or UnionType, and the SimpleTypeDefinition is then discarded.
Field Summary |
---|
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Fields inherited from interface com.saxonica.schema.SerializableSchemaComponent |
---|
ALL_COMPOSITOR, ATOMIC_TYPE, ATTRIBUTE_DECL, ATTRIBUTE_GROUP, ATTRIBUTE_GROUP_REF, ATTRIBUTE_USE, ATTRIBUTE_WILDCARD, CHOICE_COMPOSITOR, COMPLEX_TYPE, ELEMENT_DECL, ELEMENT_PARTICLE, ELEMENT_WILDCARD, FACET, KEY, KEYREF, LIST_TYPE, MODEL_GROUP, MODEL_GROUP_REF, NOTATION, SEQUENCE_COMPOSITOR, UNION_TYPE, UNIQUE |
Fields inherited from interface net.sf.saxon.type.SchemaType |
---|
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION |
Constructor Summary | |
---|---|
SimpleTypeDefinition(PreparedSchema schema)
|
Method Summary | |
---|---|
void |
addMemberType(TypeReference memberType)
|
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components |
AtomicType |
getCommonAtomicType()
Get the most specific possible atomic type that all items in this SimpleType belong to |
int |
getComponentTypeCode()
Get a unique number identifying the type of component |
UserSimpleType |
getSimpleType()
Get the simple type created for this definition |
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 |
isBuiltInType()
Determine whether this is a built-in type or a user-defined 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. |
void |
serialize(SchemaSerializer serializer)
Serialize the schema component |
void |
setIsSimpleContent(boolean b)
Indicate that this simple type represents the content type of a complex type with simple content |
void |
setItemTypeReference(TypeReference itemType)
|
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this SimpleType definition. |
ValidationException |
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 |
---|
analyzeContentExpression, applyWhitespaceNormalization, atomize, checkAgainstFacets, checkTypeDerivationIsOK, getBuiltInBaseType, getFacet, getFacetCollection, getFacetList, getFacets, getFacets, getTypedValue, getWhitespaceAction, isAtomicType, isListType, isSimpleType, isTypeDerivationOK, isUnionType, setFacetCollection |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, lookForCycles, 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 com.saxonica.schema.UserSchemaComponent |
---|
lookForCycles |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
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, getNameCode, isAnonymousType, isComplexType, isSameType |
Constructor Detail |
---|
public SimpleTypeDefinition(PreparedSchema schema)
Method Detail |
---|
public void setItemTypeReference(TypeReference itemType)
public void setIsSimpleContent(boolean b)
b
- true if this is the content type of a complex type with simple contentpublic void addMemberType(TypeReference memberType)
public UserSimpleType getSimpleType()
public AtomicType getCommonAtomicType()
getCommonAtomicType
in interface SimpleType
public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
compiler
-
SchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException, ValidationException
validate
in interface UserSchemaComponent
validate
in class UserSimpleType
SchemaException
- when this SimpleType definition is invalid.
ValidationException
public SequenceIterator getTypedValue(CharSequence value, NamespaceResolver resolver, NameChecker nameChecker) throws ValidationException
getTypedValue
in interface SimpleType
value
- the string valueresolver
- a namespace resolver used to resolve prefixes in QNames and notationsnameChecker
-
ValidationException
- if the supplied value is not in the lexical space of the data typepublic boolean isBuiltInType()
isBuiltInType
in interface SimpleType
public boolean isNamespaceSensitive()
isNamespaceSensitive
in interface SimpleType
public ValidationException validateContent(CharSequence value, NamespaceResolver nsResolver, NameChecker nameChecker)
validateContent
in interface SimpleType
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
-
UnsupportedOperationException
- if the type is namespace-sensitive and no namespace
resolver is suppliedpublic void serialize(SchemaSerializer serializer)
serialize
in interface SerializableSchemaComponent
public int getComponentTypeCode()
getComponentTypeCode
in interface SerializableSchemaComponent
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |