Package net.sf.saxon.type.gnode
Class DocumentNodeType
java.lang.Object
net.sf.saxon.type.gnode.GNodeType
net.sf.saxon.type.gnode.XNodeType
net.sf.saxon.type.gnode.DocumentNodeType
- All Implemented Interfaces:
NodePredicate,NodeTest,ItemType,ItemTypeWithSequenceTypeCache
A DocumentNodeType implements the test document-node(element(~,~))
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexplainMismatch(Item item, TypeHierarchy th) Get extra diagnostic information about why a supplied item does not conform to this item type, if available.Get the set of allowed node names that this type if capable of matchingGet an alphabetic code representing the type, or at any rate, the nearest built-in type from which this type is derived.final doubleDetermine the default priority of this node test when used on its own as a PatternGet the element test contained within this document testintDetermine the types of nodes to which this pattern applies.getUType()Get the correspondingUType.inthashCode()Returns a hash code value for the object.booleanTest whether a given item conforms to this typeNormalize this item type, returning a potentially different item type that matches the same items.toString()Methods inherited from class net.sf.saxon.type.gnode.XNodeType
asXNodeTest, getCoercionPlan, getContentType, getGenre, getRequiredFingerprint, isNillableMethods inherited from class net.sf.saxon.type.gnode.GNodeType
getAtomizedItemType, getItemType, getPrimitiveItemType, getQNameTest, isAtomicType, isAtomizable, isPlainType, one, oneOrMore, test, toShortString, zeroOrMore, zeroOrOneMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.type.ItemType
asChoiceItemType, getNormalizedDefaultPriority, toExportString
-
Constructor Details
-
DocumentNodeType
-
-
Method Details
-
getUType
Get the correspondingUType. A UType is a union of primitive item types. -
getAllowedNodeNames
Get the set of allowed node names that this type if capable of matching- Specified by:
getAllowedNodeNamesin classXNodeType- Returns:
- the allowed node names
-
getBasicAlphaCode
Get an alphabetic code representing the type, or at any rate, the nearest built-in type from which this type is derived. The codes are designed so that for any two built-in types A and B, alphaCode(A) is a prefix of alphaCode(B) if and only if A is a supertype of B.- Returns:
- the alphacode for the nearest containing built-in type. For example: for xs:string return "AS", for xs:boolean "AB", for node() "N", for element() "NE", for map(*) "FM", for array(*) "FA".
-
matches
Test whether a given item conforms to this type -
getDefaultPriority
public final double getDefaultPriority()Determine the default priority of this node test when used on its own as a Pattern- Returns:
- the default priority
-
getPrimitiveType
public int getPrimitiveType()Determine the types of nodes to which this pattern applies. Used for optimisation.- Specified by:
getPrimitiveTypein interfaceItemType- Overrides:
getPrimitiveTypein classGNodeType- Returns:
- the type of node matched by this pattern. e.g. Type.ELEMENT or Type.TEXT
-
getElementTest
Get the element test contained within this document test- Returns:
- the contained element test
-
toString
-
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
-
normalizeItemType
Description copied from interface:ItemTypeNormalize this item type, returning a potentially different item type that matches the same items. For example,record(*)andmap(*)match the same items. The default implementation returns the item type unchanged. This method does NOT expand item types to an equivalent choice item type.Item types should be normalized before comparison using equals().
- Returns:
- the normalized item type.
-
explainMismatch
Get extra diagnostic information about why a supplied item does not conform to this item type, if available. If extra information is returned, it should be in the form of a complete sentence, minus the closing full stop. No information should be returned for obvious cases.- Specified by:
explainMismatchin interfaceItemType- Specified by:
explainMismatchin interfaceNodeTest- Overrides:
explainMismatchin classGNodeType- Parameters:
item- the item that doesn't match this typeth- the type hierarchy cache- Returns:
- optionally, a message explaining why the item does not match the type
-