Free Trial - Stylus Studio, The World's Best XML IDE!


com.saxonica.importer
Class SimpleTypeDefinition

java.lang.Object
  |
  +--net.sf.saxon.type.SchemaType
        |
        +--net.sf.saxon.type.SimpleType
              |
              +--com.saxonica.importer.SimpleTypeDefinition
All Implemented Interfaces:
SchemaComponent, SchemaDeclaration, java.io.Serializable, javax.xml.transform.SourceLocator

public class SimpleTypeDefinition
extends SimpleType
implements SchemaComponent

A simple type definition holds all the information about a simpleType during the course of schema processing (unmarshalling). On completion of schema processing, more specific objects are created, for example ListType, AtomicType, or UnionType, and the SimpleTypeDefinition is then discarded.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.type.SchemaType
ALL_DERIVATIONS, DERIVE_BY_EXTENSION, DERIVE_BY_LIST, DERIVE_BY_RESTRICTION, DERIVE_BY_SUBSTITUTION, DERIVE_BY_UNION, finalProhibitions, INVALID, UNVALIDATED, VALIDATED, VALIDATING, validationPhase
 
Constructor Summary
SimpleTypeDefinition(Schema schema)
           
 
Method Summary
 void addMemberType(java.lang.Object memberType)
           
 boolean fixup(Schema schema)
          Fixup the references
 java.util.List getFacetList()
          Return all the facets for this type
 SimpleType getSimpleType()
          Get the simple type created for this definition
 SequenceIterator getTypedValue(java.lang.CharSequence value, NodeInfo node)
          Get the typed value corresponding to a given string value, assuming it is valid against this type
 void setIsSimpleContent(boolean b)
           
 void setItemType(java.lang.Object itemType)
           
 boolean validate(Schema schema)
          Checks the validity of this SimpleType definition.
 void validateContent(java.lang.CharSequence value, NamespaceResolver nsResolver)
          Check whether a given input string is valid according to this SimpleType
 
Methods inherited from class net.sf.saxon.type.SimpleType
applyWhitespaceNormalization, getBuiltInBaseType, getFacet, getFacetCollection, getFacets, getFacets, getTypedValue, getWhitespaceAction, isListType, isNamespaceSensitive, isSimpleType, isTypeDerivationOK, isUnionType, iterateMemberTypes, setFacetCollection, validate
 
Methods inherited from class net.sf.saxon.type.SchemaType
allowsDerivation, checkDerivation, containingDeclarationIsElement, getBaseType, getBaseTypeFingerprint, getBlock, getColumnNumber, getContainingDeclarationName, getDerivationMethod, getDescription, getDisplayName, getFingerprint, getLineNumber, getLocalName, getNamePool, getPublicId, getSystemId, isComplexType, setBaseType, setBaseTypeFingerprint, setContainingDeclaration, setDerivationMethod, setDerivationMethodName, setFinalProhibitions, setFingerprint, setLineNumber, setLocalName, setLocator, setNamePool, setSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTypeDefinition

public SimpleTypeDefinition(Schema schema)
Method Detail

setItemType

public void setItemType(java.lang.Object itemType)

setIsSimpleContent

public void setIsSimpleContent(boolean b)

addMemberType

public void addMemberType(java.lang.Object memberType)

getSimpleType

public SimpleType getSimpleType()
Get the simple type created for this definition


fixup

public boolean fixup(Schema schema)
              throws SchemaException
Fixup the references

Specified by:
fixup in interface SchemaComponent
Parameters:
schema - The schema is used for reporting errors
Returns:
true if all is well, false if errors found
SchemaException

getFacetList

public java.util.List getFacetList()
Return all the facets for this type

Returns:
the list of facets defined on this simple type (this doesn't include inherited facets)

validate

public boolean validate(Schema schema)
                 throws javax.xml.transform.TransformerException
Checks the validity of this SimpleType definition.

Specified by:
validate in interface SchemaComponent
Parameters:
schema - if this is not null, any errors that are detected should be reported using the error() method of this schema.
Returns:
true when this Schema definition is valid, otherwise false.
Throws:
javax.xml.transform.TransformerException - when this SimpleType definition is invalid.

getTypedValue

public SequenceIterator getTypedValue(java.lang.CharSequence value,
                                      NodeInfo node)
                               throws ValidationException
Get the typed value corresponding to a given string value, assuming it is valid against this type

Specified by:
getTypedValue in class SimpleType
Parameters:
value - the string value
node - the containing node (used to resolve QName prefixes)
Returns:
an iterator over the atomic sequence comprising the typed value
ValidationException

validateContent

public void validateContent(java.lang.CharSequence value,
                            NamespaceResolver nsResolver)
                     throws ValidationException
Check whether a given input string is valid according to this SimpleType

Specified by:
validateContent in class SimpleType
Parameters:
value - the input string to be checked
nsResolver - 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.
Throws:
ValidationException - if the content is invalid
java.lang.UnsupportedOperationException - if the type is namespace-sensitive and no namespace resolver is supplied


Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.