|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.type.SchemaType | +--net.sf.saxon.type.SimpleType | +--net.sf.saxon.type.ListType
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.
In the non-schema-aware product this class is used to implement the built-in list types NMTOKENS, ENTITIES, IDREFS. In the schema-aware product it is also used to support user-defined list types.
Field Summary |
Fields inherited from class net.sf.saxon.type.SchemaType |
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION, finalProhibitions, INVALID, UNVALIDATED, VALIDATED, VALIDATING, validationPhase |
Constructor Summary | |
ListType(NamePool pool)
Create a new ListType. |
Method Summary | |
java.lang.String |
applyWhitespaceNormalization(java.lang.String value)
Apply the whitespace normalization rules for this simple type |
SimpleType |
getItemType()
Returns the simpleType of the items in this ListType. |
SequenceIterator |
getTypedValue(java.lang.CharSequence value,
NamespaceResolver resolver)
Get the typed value of a given input string. |
boolean |
isDerivedFrom(java.lang.String typeNamespaceArg,
java.lang.String typeNameArg,
int derivationMethod)
This method returns true if there is a derivation between the reference type definition, that is the TypeInfo on which the method is being called, and the other type definition, that is the one passed as parameters. |
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 |
java.lang.Object |
map(Item item,
XPathContext context,
java.lang.Object info)
The typed value of a list-valued node is obtained by tokenizing the string value and applying a mapping function to the sequence of tokens. |
int |
relationshipTo(SchemaType other)
Determine the relationship of this schema type to another schema type. |
void |
setItemType(SimpleType type)
Sets the itemType for this ListType (the type of item that instances of this list type contain). |
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, isNamespaceSensitive, isSimpleType, isTypeDerivationOK, isUnionType, iterateMemberTypes, setFacetCollection, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ListType(NamePool pool)
Method Detail |
public boolean isListType()
isListType
in class SimpleType
public SimpleType getItemType()
public boolean isDerivedFrom(java.lang.String typeNamespaceArg, java.lang.String typeNameArg, int derivationMethod)
isDerivedFrom
in interface TypeInfo
isDerivedFrom
in class SchemaType
typeNamespaceArg
- the namespace of the "other" typetypeNameArg
- the local name of the "other" typederivationMethod
- the derivation method: zero or more of TypeInfo.DERIVATION_RESTRICTION
,
TypeInfo.DERIVATION_EXTENSION
, TypeInfo.DERIVATION_LIST
, or TypeInfo.DERIVATION_UNION
.
Zero means derived by any possible route.public void setItemType(SimpleType type) throws SchemaException
type
- the SimpleType for this ListType.
SchemaException
public int relationshipTo(SchemaType other)
relationshipTo
in class SchemaType
other
- the other schema type
Type.SAME_TYPE
if the types are the same; Type.SUBSUMES
if the first
type subsumes the second (that is, all instances of the second type are also instances
of the first); Type.SUBSUMED_BY
if the second type subsumes the first;
Type.OVERLAPS
if the two types overlap (have a non-empty intersection);
Type.DISJOINT
if the two types are disjoint (have an empty intersection)public java.lang.String applyWhitespaceNormalization(java.lang.String value)
value
- the string before whitespace normalization
public void validateContent(java.lang.CharSequence value, NamespaceResolver nsResolver) throws ValidationException
validateContent
in class 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.
ValidationException
- if the content is invalid
java.lang.UnsupportedOperationException
- if the type is namespace-sensitive and no namespace
resolver is suppliedpublic SequenceIterator getTypedValue(java.lang.CharSequence value, NamespaceResolver resolver) throws ValidationException
getTypedValue
in class SimpleType
value
- the string whose typed value is requiredresolver
-
AtomicValue
ValidationException
public java.lang.Object map(Item item, XPathContext context, java.lang.Object info) throws XPathException
MappingFunction
map
in interface MappingFunction
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.
XPathException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |