net.sf.saxon.type
Class SimpleType

java.lang.Object
  extended by net.sf.saxon.type.SchemaType
      extended by net.sf.saxon.type.SimpleType
All Implemented Interfaces:
Serializable, SourceLocator
Direct Known Subclasses:
AnySimpleType, AtomicType, ListType

public abstract class SimpleType
extends SchemaType

An XML Schema SimpleType

Version:
$Revision: 1.1 $ $Date: 2004/03/09 10:10:35 $
Author:
Keith Visco
See Also:
Serialized Form

Field Summary
static String FINAL_ALL
          The value of the final attribute used for blocking all types of derivation
static String FINAL_LIST
          The value of the final attribute used for blocking list derivation
static String FINAL_RESTRICTION
          The value of the final attribute used for blocking restriction derivation
static String FINAL_UNION
          The value of the final attribute used for blocking union derivation
 
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
SimpleType()
          Default constructor
 
Method Summary
 void addFacet(Facet facet)
          Adds the given Facet to this Simpletype.
 SimpleType getBuiltInBaseType()
          Returns the built in type this type is derived from.
 Facet getFacet(String name)
          Returns the first facet associated with the given name
 List getFacetList()
          Returns the facets associated with the given name
 FacetListIterator getFacets()
          Returns an Enumeration of all the Facets (including inherited) facets for this type.
 Iterator getFacets(String name)
          Returns the facets associated with the given name
 Iterator getLocalFacets()
          Returns the facets of this type (without the parent's facets)
abstract  SequenceIterator getTypedValue(CharSequence value)
          Get the typed value corresponding to a given string value, assuming it is valid against this type
 SequenceIterator getTypedValue(NodeInfo node)
          Get the typed value of a node that is annotated with this schema type
 boolean isListType()
          Returns true if this type is derived by list, or if it is derived by restriction from a list type, or if it is a union that contains a list as one of its members
 boolean isNamespaceSensitive()
          Test whether this simple type is namespace-sensitive, that is, whether it is derived from xs:QName or xs:NOTATION
 boolean isSimpleType()
          Returns true if this SchemaType is a SimpleType
 void setFacets(List facets)
          Set all the facets of this simple type
 boolean validate(SchemaMarker schema)
          Checks the validity of this SimpleType defintion.
abstract  void validateContent(CharSequence value, NamespaceResolver namespaceResolver)
          Check whether a given input string is valid according to this SimpleType
 
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, isValidRestriction, setBaseType, setBaseTypeFingerprint, setContainingDeclaration, setDerivationMethod, setDerivationMethodName, setFinal, 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
 

Field Detail

FINAL_ALL

public static final String FINAL_ALL
The value of the final attribute used for blocking all types of derivation

See Also:
Constant Field Values

FINAL_LIST

public static final String FINAL_LIST
The value of the final attribute used for blocking list derivation

See Also:
Constant Field Values

FINAL_UNION

public static final String FINAL_UNION
The value of the final attribute used for blocking union derivation

See Also:
Constant Field Values

FINAL_RESTRICTION

public static final String FINAL_RESTRICTION
The value of the final attribute used for blocking restriction derivation

See Also:
Constant Field Values
Constructor Detail

SimpleType

public SimpleType()
Default constructor

Method Detail

isSimpleType

public final boolean isSimpleType()
Returns true if this SchemaType is a SimpleType

Specified by:
isSimpleType in class SchemaType
Returns:
true

isListType

public boolean isListType()
Returns true if this type is derived by list, or if it is derived by restriction from a list type, or if it is a union that contains a list as one of its members


setFacets

public void setFacets(List facets)
Set all the facets of this simple type


addFacet

public void addFacet(Facet facet)
Adds the given Facet to this Simpletype.

Parameters:
facet - the Facet to add to this Simpletype

getFacet

public Facet getFacet(String name)
Returns the first facet associated with the given name

Returns:
the first facet associated with the given name

getFacetList

public List getFacetList()
Returns the facets associated with the given name

Returns:
the facets associated with the given name

getFacets

public Iterator getFacets(String name)
Returns the facets associated with the given name

Returns:
the facets associated with the given name

getFacets

public FacetListIterator getFacets()
Returns an Enumeration of all the Facets (including inherited) facets for this type.

Returns:
an Enumeration of all the Facets for this type

getLocalFacets

public Iterator getLocalFacets()
Returns the facets of this type (without the parent's facets)


getBuiltInBaseType

public SimpleType getBuiltInBaseType()
Returns the built in type this type is derived from.


isNamespaceSensitive

public boolean isNamespaceSensitive()
Test whether this simple type is namespace-sensitive, that is, whether it is derived from xs:QName or xs:NOTATION


validate

public boolean validate(SchemaMarker schema)
                 throws TransformerException
Checks the validity of this SimpleType defintion.

Throws:
TransformerException - when this SimpleType definition is invalid.

validateContent

public abstract void validateContent(CharSequence value,
                                     NamespaceResolver namespaceResolver)
                              throws ValidationException
Check whether a given input string is valid according to this SimpleType

Throws:
ValidationException

getTypedValue

public final SequenceIterator getTypedValue(NodeInfo node)
                                     throws XPathException
Get the typed value of a node that is annotated with this schema type

Specified by:
getTypedValue in class SchemaType
Throws:
XPathException

getTypedValue

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

Parameters:
value - the string value
Returns:
an iterator over the atomic sequence comprising the typed value
Throws:
ValidationException