Package net.sf.saxon.type.gnode
Class AnyGNodeType
java.lang.Object
net.sf.saxon.type.gnode.GNodeType
net.sf.saxon.type.gnode.AnyGNodeType
- All Implemented Interfaces:
NodePredicate,NodeTest,ItemType,ItemTypeWithSequenceTypeCache
Class
AnyGNodeType corresponds to the item type gnode(). It
matches any XNode or JNode.-
Method Summary
Modifier and TypeMethodDescriptionExpand this item type to a choice item type.asXNodeTest(Configuration config) Get an XNodeTest that will match any XNode that this NodeTest matches: that is, eliminate the possibility of matching a JNode.explainMismatch(Item item, TypeHierarchy th) Get extra diagnostic information about why a supplied item does not conform to this item type, if available.Get an alphabetic code representing the type, or at any rate, the nearest built-in type from which this type is derived.getCoercionPlan(int version) Get the coercion plan for use when this type is the required type for (say) coercion of arguments in a function callfinal doubleDetermine the default priority of this node test when used on its own as a Patternstatic AnyGNodeTypeGet an instance of AnyNodeTestgetUType()Get the correspondingUType.booleanDetermine whether the content type (if present) is nillablebooleanTest whether a given item conforms to this typetoString()Methods inherited from class net.sf.saxon.type.gnode.GNodeType
getAtomizedItemType, getContentType, getGenre, getItemType, getPrimitiveItemType, getPrimitiveType, getQNameTest, isAtomicType, isAtomizable, isPlainType, one, oneOrMore, test, toShortString, zeroOrMore, zeroOrOneMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.type.ItemType
getNormalizedDefaultPriority, normalizeItemType, toExportString
-
Method Details
-
getInstance
Get an instance of AnyNodeTest- Returns:
- the singleton instance of this class
-
getUType
Get the correspondingUType. A UType is a union of primitive item types. -
asXNodeTest
Description copied from interface:NodeTestGet an XNodeTest that will match any XNode that this NodeTest matches: that is, eliminate the possibility of matching a JNode. -
getCoercionPlan
Get the coercion plan for use when this type is the required type for (say) coercion of arguments in a function call- Specified by:
getCoercionPlanin interfaceItemType- Overrides:
getCoercionPlanin classGNodeType- Parameters:
version- the XPath language version (40 or 31)
-
asChoiceItemType
Description copied from interface:ItemTypeExpand this item type to a choice item type. The default delivers a choice with this type as its only member. Implementations for abstract types return a choice of the corresponding concrete types, for examplenode()expands to a choice of the seven node kinds. The implementation for a choice type that includes abstract member types should expand these recursively. -
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
-
toString
-
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".
-
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
-
isNillable
public boolean isNillable()Determine whether the content type (if present) is nillable- Returns:
- true if the content test (when present) can match nodes that are nilled
-