public class ElementNode extends AbstractNode
| Modifier and Type | Field and Description |
|---|---|
private static AttributeNode |
ATTRIBUTE_NODE_UNINITIALIZED
Holder value for lazy creation of attribute node.
|
private AttributeNode |
attributeNode
The text attribute node.
|
private int |
depth
Depth of the node.
|
private DetailAST |
detailAst
The ast node.
|
private static AbstractNode[] |
EMPTY_ABSTRACT_NODE_ARRAY
Constant for optimization.
|
private int |
indexAmongSiblings
Represents index among siblings.
|
private AbstractNode |
parent
The parent of the current node.
|
private AbstractNode |
root
The root node.
|
private static java.lang.String |
TEXT_ATTRIBUTE_NAME
String literal for text attribute.
|
| Constructor and Description |
|---|
ElementNode(AbstractNode root,
AbstractNode parent,
DetailAST detailAst,
int depth,
int indexAmongSiblings)
Creates a new
ElementNode instance. |
| Modifier and Type | Method and Description |
|---|---|
private static int |
compareCommonAncestorChildrenOrder(net.sf.saxon.om.NodeInfo first,
net.sf.saxon.om.NodeInfo second)
Walks up the hierarchy until a common ancestor is found.
|
int |
compareOrder(net.sf.saxon.om.NodeInfo other)
Compares current object with specified for order.
|
protected java.util.List<AbstractNode> |
createChildren()
Iterates children of the current node and
recursively creates new Xpath-nodes.
|
private AttributeNode |
getAttributeNode()
Checks if token type supports
@text attribute,
extracts its value, creates AttributeNode object and returns it. |
java.lang.String |
getAttributeValue(java.lang.String namespace,
java.lang.String localPart)
Returns attribute value.
|
int |
getColumnNumber()
Returns column number.
|
int |
getDepth()
Getter method for node depth.
|
private java.util.List<AbstractNode> |
getFollowingSiblings()
Returns following siblings of the current node.
|
private net.sf.saxon.tree.iter.AxisIterator |
getFollowingSiblingsIterator()
Returns following sibling axis iterator.
|
int |
getLineNumber()
Returns line number.
|
java.lang.String |
getLocalPart()
Returns local part.
|
int |
getNodeKind()
Returns type of the node.
|
net.sf.saxon.om.NodeInfo |
getParent()
Returns parent.
|
private java.util.List<AbstractNode> |
getPrecedingSiblings()
Returns preceding siblings of the current node.
|
private net.sf.saxon.tree.iter.AxisIterator |
getPrecedingSiblingsIterator()
Returns preceding sibling axis iterator.
|
net.sf.saxon.om.NodeInfo |
getRoot()
Returns root.
|
int |
getTokenType()
Getter method for token type.
|
DetailAST |
getUnderlyingNode()
Returns underlying node.
|
boolean |
hasChildNodes()
Determine whether the node has any children.
|
net.sf.saxon.tree.iter.AxisIterator |
iterateAxis(int axisNumber)
Determines axis iteration algorithm.
|
private static java.lang.UnsupportedOperationException |
throwUnsupportedOperationException()
Returns UnsupportedOperationException exception.
|
atomize, copy, generateId, getAllNamespaces, getBaseURI, getChildren, getConfiguration, getDeclaredNamespaces, getDisplayName, getFingerprint, getPrefix, getPublicId, getSchemaType, getStringValue, getStringValueCS, getSystemId, getTreeInfo, getURI, hasFingerprint, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, iterateAxis, saveLocation, setSystemIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitattributes, children, children, equals, getGenre, hashCode, toShortStringgetLength, head, itemAt, iterate, reduce, subsequence, toGroundedValueprivate static final java.lang.String TEXT_ATTRIBUTE_NAME
private static final AbstractNode[] EMPTY_ABSTRACT_NODE_ARRAY
private static final AttributeNode ATTRIBUTE_NODE_UNINITIALIZED
private final AbstractNode root
private final AbstractNode parent
private final int depth
private final int indexAmongSiblings
private AttributeNode attributeNode
public ElementNode(AbstractNode root, AbstractNode parent, DetailAST detailAst, int depth, int indexAmongSiblings)
ElementNode instance.root - Node root of the treeparent - Node parent of the current nodedetailAst - reference to DetailASTdepth - the current node depth in the hierarchyindexAmongSiblings - the current node index among the parent children nodespublic int compareOrder(net.sf.saxon.om.NodeInfo other)
other - another NodeInfo objectprivate static int compareCommonAncestorChildrenOrder(net.sf.saxon.om.NodeInfo first, net.sf.saxon.om.NodeInfo second)
first - NodeInfo to comparesecond - NodeInfo to compare0 if first == second;
a value less than 0 if first should be first;
a value greater than 0 if second should be first.public int getDepth()
getDepth in class AbstractNodeprotected java.util.List<AbstractNode> createChildren()
createChildren in class AbstractNodepublic boolean hasChildNodes()
true is the node has any children.public java.lang.String getAttributeValue(java.lang.String namespace, java.lang.String localPart)
UnsupportedOperationException in case,
when name of the attribute is not equal to 'text'.namespace - namespacelocalPart - actual name of the attributepublic java.lang.String getLocalPart()
public int getNodeKind()
public net.sf.saxon.om.NodeInfo getParent()
public net.sf.saxon.om.NodeInfo getRoot()
public net.sf.saxon.tree.iter.AxisIterator iterateAxis(int axisNumber)
UnsupportedOperationException in case,
when there is no axis iterator for given axisNumber.
Reason of suppression for resource, IOResourceOpenedButNotSafelyClosed:
AxisIterator implements Closeable interface,
but none of the subclasses of the AxisIterator
class has non-empty close() method.
axisNumber - element from AxisInfoAxisIterator objectpublic int getLineNumber()
public int getColumnNumber()
public int getTokenType()
getTokenType in class AbstractNodepublic DetailAST getUnderlyingNode()
getUnderlyingNode in class AbstractNodeprivate net.sf.saxon.tree.iter.AxisIterator getPrecedingSiblingsIterator()
Reason of suppression for resource, IOResourceOpenedButNotSafelyClosed:
AxisIterator implements Closeable interface,
but none of the subclasses of the AxisIterator
class has non-empty close() method.
private net.sf.saxon.tree.iter.AxisIterator getFollowingSiblingsIterator()
Reason of suppression for resource, IOResourceOpenedButNotSafelyClosed:
AxisIterator implements Closeable interface,
but none of the subclasses of the AxisIterator
class has non-empty close() method.
private java.util.List<AbstractNode> getFollowingSiblings()
private java.util.List<AbstractNode> getPrecedingSiblings()
private AttributeNode getAttributeNode()
@text attribute,
extracts its value, creates AttributeNode object and returns it.
Value can be accessed using @text attribute.null valueprivate static java.lang.UnsupportedOperationException throwUnsupportedOperationException()
Copyright © 2001-2022. All Rights Reserved.