net.sf.saxon.type
Class ListType

java.lang.Object
  extended bynet.sf.saxon.type.SchemaType
      extended bynet.sf.saxon.type.SimpleType
          extended bynet.sf.saxon.type.ListType
All Implemented Interfaces:
MappingFunction, Serializable, SourceLocator

public class ListType
extends SimpleType
implements MappingFunction

Represents a SimpleType that is a list of a given SimpleType, known as its itemType. A ListType may be a restriction of another ListType; the itemType must either be an AtomicType or a UnionType whose members are not list types.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.type.SimpleType
FINAL_ALL, FINAL_LIST, FINAL_RESTRICTION, FINAL_UNION
 
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
ListType(NamePool pool)
          Create a new ListType.
 
Method Summary
 SimpleType getItemType()
          Returns the simpleType of the items in this ListType.
 SequenceIterator getTypedValue(CharSequence value)
          Get the typed value of a given input string.
 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
 Object map(Item item, XPathContext context, Object info)
          Implement the mapping function
 void setItemType(SimpleType type)
          Sets the itemType for this ListType (the type of item that instances of this list type contain).
 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.SimpleType
addFacet, getBuiltInBaseType, getFacet, getFacetList, getFacets, getFacets, getLocalFacets, getTypedValue, isNamespaceSensitive, isSimpleType, setFacets, 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, 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
 

Constructor Detail

ListType

public ListType(NamePool pool)
Create a new ListType.

Method Detail

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

Overrides:
isListType in class SimpleType

getItemType

public SimpleType getItemType()
Returns the simpleType of the items in this ListType.

Returns:
the simpleType of the items in this ListType.

setItemType

public void setItemType(SimpleType type)
                 throws SchemaException
Sets the itemType for this ListType (the type of item that instances of this list type contain).

Parameters:
type - the SimpleType for this ListType.
Throws:
SchemaException

validateContent

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

Specified by:
validateContent in class SimpleType
Throws:
ValidationException

getTypedValue

public SequenceIterator getTypedValue(CharSequence value)
                               throws ValidationException
Get the typed value of a given input string. This method assumes that the input value is valid according to this SimpleType

Specified by:
getTypedValue in class SimpleType
Parameters:
value - the string value
Returns:
an iterator over the atomic sequence comprising the typed value
Throws:
ValidationException

map

public Object map(Item item,
                  XPathContext context,
                  Object info)
           throws XPathException
Implement the mapping function

Specified by:
map in interface MappingFunction
Parameters:
item - The item to be mapped. If context is supplied, this must be the same as context.currentItem().
context - The processing context. This is supplied only for mapping constructs that set the context node, position, and size. Otherwise it is null.
info - Arbitrary information supplied by the creator of the MappingIterator. It must be read-only and immutable for the duration of the iteration.
Returns:
either (a) a SequenceIterator over the sequence of items that the supplied input item maps to, or (b) an Item if it maps to a single item, or (c) null if it maps to an empty sequence.
Throws:
XPathException