public class SimpleTypeDefinition extends UserSimpleType implements UserSchemaComponent
UserListType
, UserAtomicType
, or UserUnionType
, and the SimpleTypeDefinition is then
discarded.extendedTypes, finalProhibitions
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION
Constructor and Description |
---|
SimpleTypeDefinition(EnterpriseConfiguration config)
Create a SimpleTypeDefinition
|
Modifier and Type | Method and Description |
---|---|
void |
addMemberType(TypeReference memberType)
Add a member type to this union type
|
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components
|
UserSimpleType |
getSimpleType()
Get the simple type created for this definition
|
AtomicSequence |
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 |
isBuiltInType()
Determine whether this is a built-in type or a user-defined type
|
boolean |
isListType()
On a SimpleTypeDefinition, isListType() always returns true if the type is "derived by List".
|
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()
On a SimpleTypeDefinition, isUnionType() always returns true if the type is "derived by Union".
|
void |
serialize(SchemaModelSerializer serializer)
Serialize the schema component
|
protected void |
serializeVariety(SchemaModelSerializer serializer) |
void |
setIsSimpleContent(boolean b)
Indicate that this simple type represents the content type of a complex type with simple content
|
void |
setItemTypeReference(TypeReference itemType)
Set the reference to an item type of this list type
|
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this SimpleType definition.
|
ValidationFailure |
validateContent(CharSequence value,
NamespaceResolver nsResolver,
ConversionRules rules)
Check whether a given input string is valid according to this SimpleType
|
addFacet, addInheritedFacets, analyzeContentExpression, applyWhitespaceNormalization, atomize, checkAgainstFacets, checkTypeDerivationIsOK, convertFacetValues, elaborate, getBuiltInBaseType, getComponentAsFunction, getComponentAsFunction, getContextComponent, getEQName, getExtendedFacetList, getFacet, getLocalFacetList, getWhitespaceAction, isIdRefType, isIdType, isSimpleType, isTypeDerivationOK, mergeEnumerationFacets, postprocess, preprocess, setContextComponent, setFacetList
allowsDerivation, containingDeclarationIsElement, getBaseType, getBaseTypeFingerprint, getBaseTypeReference, getBlock, getContainingDeclarationName, getDerivationMethod, getDescription, getDisplayName, getExtensionTypes, getFinalProhibitions, getFingerprint, getLocalName, getName, getNameCode, getNamePool, getTargetNamespace, isAnonymousType, isComplexType, isExternalType, isSameType, registerExtensionType, setBaseTypeReference, setContainingDeclaration, setDerivationMethod, setDerivationMethodName, setExtendedTypes, setFinalProhibitions, setNameCode
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, lookForCycles, makeXPathExpressionPropertyRecord, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
elaborate, lookForCycles
getComponentAsFunction, getRedefinitionLevel, getValidationStatus
isExternalType
allowsDerivation, getBaseType, getBlock, getDerivationMethod, getDescription, getDisplayName, getFinalProhibitions, getFingerprint, getName, getNameCode, getSystemId, getTargetNamespace, isAnonymousType, isComplexType, isSameType
public SimpleTypeDefinition(EnterpriseConfiguration config)
config
- the Saxon configurationpublic void setItemTypeReference(TypeReference itemType)
itemType
- reference to a type forming the item type of this list typepublic boolean isAtomicType()
isAtomicType
in interface SchemaType
isAtomicType
in interface SimpleType
isAtomicType
in class UserSimpleType
public boolean isListType()
isListType
in interface SimpleType
isListType
in class UserSimpleType
public boolean isUnionType()
isUnionType
in interface SimpleType
isUnionType
in class UserSimpleType
public void setIsSimpleContent(boolean b)
b
- true if this is the content type of a complex type with simple contentpublic void addMemberType(TypeReference memberType)
memberType
- the member type to be addedpublic UserSimpleType getSimpleType()
public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
fixup
in class SchemaStructure
compiler
- used for error reportingSchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
validate
in class UserSimpleType
compiler
- used for error reportingSchemaException
- when this SimpleType definition is invalid.public AtomicSequence getTypedValue(CharSequence value, NamespaceResolver resolver, ConversionRules rules) throws ValidationException
getTypedValue
in interface SimpleType
value
- the string valueresolver
- a namespace resolver used to resolve prefixes in QNames and notationsrules
- the conversion rules for the ConfigurationValidationException
- if the supplied value is invalid against this simple typepublic boolean isBuiltInType()
isBuiltInType
in interface SimpleType
public boolean isNamespaceSensitive()
isNamespaceSensitive
in interface SimpleType
public ValidationFailure validateContent(CharSequence value, NamespaceResolver nsResolver, ConversionRules rules)
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.rules
- the conversion rules for the configurationUnsupportedOperationException
- if the type is namespace-sensitive and no namespace
resolver is suppliedpublic void serialize(SchemaModelSerializer serializer)
serialize
in interface SerializableSchemaComponent
serialize
in class UserSimpleType
serializer
- the object responsible for performing the serializationprotected void serializeVariety(SchemaModelSerializer serializer) throws XPathException
serializeVariety
in class UserSimpleType
XPathException
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.