Package net.sf.saxon.ma.jnode
Class JNode
java.lang.Object
net.sf.saxon.ma.jnode.JNode
- All Implemented Interfaces:
GNode,GroundedValue,Item,Sequence
- Direct Known Subclasses:
ChildJNode,RootJNode
Abstract implementation of JNode, covering both root and non-root JNodes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionatomize()Atomize the item.abstract GroundedValueGet the value of the content propertygetGenre()Get the genre of this item (to distinguish the top-level categories of item, such as nodes, atomic values, and functions)intGet the node kindabstract JNodeGet the parent of this JNodeabstract intGet the value of the position propertygetRoot()Get the root of this JTreeabstract AtomicValueGet the value of the selector propertyGet the value of the item as a Unicode string.booleanAsk whether the JNode has any childrenProvide a short string showing the contents of the item, suitable for use in error messagestoString()Returns a string representation of the object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.GNode
compareOrder, generateId, iterateAncestorAxis, iterateAncestorOrSelfAxis, iterateAttributeAxis, iterateChildAxis, iterateDescendantAxis, iterateDescendantOrSelfAxis, iterateFollowingAxis, iterateFollowingOrSelfAxis, iterateFollowingSiblingAxis, iterateFollowingSiblingOrSelfAxis, iterateNamespaceAxis, iterateParentAxis, iteratePrecedingAxis, iteratePrecedingOrSelfAxis, iteratePrecedingSiblingAxis, iteratePrecedingSiblingOrSelfAxis, iterateSelfAxisMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
getLabel, getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
JNode
public JNode()
-
-
Method Details
-
getContent
Get the value of the content property- Returns:
- the content of the JNode
-
hasChildNodes
public boolean hasChildNodes()Ask whether the JNode has any children- Specified by:
hasChildNodesin interfaceGNode- Returns:
- true if there are children: that is, if the content includes an array or map
-
getPosition
public abstract int getPosition()Get the value of the position property- Returns:
- the position
-
getSelector
Get the value of the selector property- Returns:
- the selector. Returns null if the property is absent (for a root JNode)
-
getParent
Get the parent of this JNode -
getRoot
Get the root of this JTree- Returns:
- the root of the tree
-
getNodeKind
public int getNodeKind()Get the node kind- Specified by:
getNodeKindin interfaceGNode- Returns:
Type.JNODE
-
getGenre
Get the genre of this item (to distinguish the top-level categories of item, such as nodes, atomic values, and functions) -
getUnicodeStringValue
Get the value of the item as a Unicode string. For nodes, this is the string value of the node as defined in the XPath 2.0 data model, except that all nodes are treated as being untyped: it is not an error to get the string value of a node with a complex type. For atomic values, the method returns the result of casting the atomic value to a string.- Specified by:
getUnicodeStringValuein interfaceGroundedValue- Specified by:
getUnicodeStringValuein interfaceItem- Returns:
- the string value of the item
- Throws:
UnsupportedOperationException- if the item is a function item (an unchecked exception is used here to avoid introducing exception handling to a large number of paths where it is not needed)- Since:
- 8.4
-
atomize
Atomize the item.- Specified by:
atomizein interfaceItem- Returns:
- the result of atomization
- Throws:
XPathException- if atomization is not allowed for this kind of item
-
toString
Returns a string representation of the object. -
toShortString
Description copied from interface:ItemProvide a short string showing the contents of the item, suitable for use in error messages- Specified by:
toShortStringin interfaceGroundedValue- Specified by:
toShortStringin interfaceItem- Returns:
- a depiction of the item suitable for use in error messages
-