Class JNodeType

java.lang.Object
net.sf.saxon.type.gnode.GNodeType
net.sf.saxon.ma.jnode.JNodeType
All Implemented Interfaces:
NodePredicate, NodeTest, ItemType, ItemTypeWithSequenceTypeCache
Direct Known Subclasses:
AnyJNodeType, RootJNodeType, SpecificJNodeType

public abstract class JNodeType extends GNodeType
  • Constructor Details

    • JNodeType

      public JNodeType()
  • Method Details

    • getValueType

      public SequenceType getValueType()
    • getGenre

      public Genre getGenre()
      Determine the Genre (top-level classification) of this type
      Specified by:
      getGenre in interface ItemType
      Overrides:
      getGenre in class GNodeType
      Returns:
      the Genre to which this type belongs, for example node or atomic value
    • getPrimitiveItemType

      public ItemType getPrimitiveItemType()
      Get the primitive item type corresponding to this item type. For item(), this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds, it is the value representing the node kind, for example Type.ELEMENT. For anyAtomicValue and union types it is Type.ATOMIC_VALUE. For numeric it is Type.NUMBER. For other atomic types it is the primitive type as defined in XML Schema, except that integer, xs:dayTimeDuration, and xs:yearMonthDuration are considered to be primitive types.
      Specified by:
      getPrimitiveItemType in interface ItemType
      Overrides:
      getPrimitiveItemType in class GNodeType
      Returns:
      the corresponding primitive type
    • getPrimitiveType

      public int getPrimitiveType()
      Get the primitive type corresponding to this item type. For item(), this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds, it is the value representing the node kind, for example Type.ELEMENT. For anyAtomicValue it is BuiltInAtomicType.ANY_ATOMIC. For numeric it is Type.NUMBER. For other atomic types it is the primitive type as defined in XML Schema, except that INTEGER is considered to be a primitive type.
      Specified by:
      getPrimitiveType in interface ItemType
      Overrides:
      getPrimitiveType in class GNodeType
      Returns:
      the integer fingerprint of the corresponding primitive type
    • getUType

      public UType getUType()
      Get the corresponding UType. A UType is a union of primitive item types.
      Specified by:
      getUType in interface ItemType
      Specified by:
      getUType in interface NodeTest
      Overrides:
      getUType in class GNodeType
      Returns:
      the smallest UType that subsumes this item type
    • getDefaultPriority

      public double getDefaultPriority()
      Get the default priority when this ItemType is used as an XSLT pattern
      Returns:
      the default priority
    • getCoercionPlan

      public CoercionPlan getCoercionPlan(int version)
      Get the coercion plan for use when this type is the required type for (say) coercion of arguments in a function call
      Specified by:
      getCoercionPlan in interface ItemType
      Overrides:
      getCoercionPlan in class GNodeType
      Parameters:
      version - the XPath language version (40 or 31)
    • getBasicAlphaCode

      public String 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".
    • asXNodeTest

      public NodeTest asXNodeTest(Configuration config)
      Description copied from interface: NodeTest
      Get an XNodeTest that will match any XNode that this NodeTest matches: that is, eliminate the possibility of matching a JNode.