Class AbstractRootNode
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.xpath.AbstractNode
-
- com.puppycrawl.tools.checkstyle.xpath.AbstractRootNode
-
- All Implemented Interfaces:
Source
,SourceLocator
,net.sf.saxon.lib.ActiveSource
,net.sf.saxon.om.GroundedValue
,net.sf.saxon.om.Item
,net.sf.saxon.om.NodeInfo
,net.sf.saxon.om.Sequence
,net.sf.saxon.s9api.Location
,Locator
- Direct Known Subclasses:
RootNode
public abstract class AbstractRootNode extends AbstractNode
Represents root node of Xpath-tree.
-
-
Field Summary
Fields Modifier and Type Field Description private static AbstractNode[]
EMPTY_ABSTRACT_NODE_ARRAY
Constant for optimization.private static String
ROOT_NAME
Name of the root element.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRootNode()
Creates a newAbstractRootNode
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareOrder(net.sf.saxon.om.NodeInfo nodeInfo)
Compares current object with specified for order.String
getAttributeValue(net.sf.saxon.om.NamespaceUri namespace, String localPart)
Returns attribute value.int
getDepth()
Getter method for node depth.String
getLocalPart()
Returns local part.int
getNodeKind()
Returns type of the node.net.sf.saxon.om.NodeInfo
getParent()
Returns parent.net.sf.saxon.om.NodeInfo
getRoot()
Returns root of the tree.net.sf.saxon.tree.iter.AxisIterator
iterateAxis(int axisNumber)
Determines axis iteration algorithm.private static UnsupportedOperationException
throwUnsupportedOperationException()
Returns UnsupportedOperationException exception.-
Methods inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractNode
atomize, copy, createChildren, generateId, getAllNamespaces, getBaseURI, getChildren, getConfiguration, getDeclaredNamespaces, getDisplayName, getFingerprint, getNamespaceUri, getPrefix, getPublicId, getSchemaType, getStringValue, getSystemId, getTokenType, getTreeInfo, getUnderlyingNode, getUnicodeStringValue, getURI, hasFingerprint, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, iterateAxis, saveLocation, setSystemId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, head, itemAt, iterate, reduce, subsequence
-
-
-
-
Field Detail
-
ROOT_NAME
private static final String ROOT_NAME
Name of the root element.- See Also:
- Constant Field Values
-
EMPTY_ABSTRACT_NODE_ARRAY
private static final AbstractNode[] EMPTY_ABSTRACT_NODE_ARRAY
Constant for optimization.
-
-
Constructor Detail
-
AbstractRootNode
protected AbstractRootNode()
Creates a newAbstractRootNode
instance.
-
-
Method Detail
-
compareOrder
public int compareOrder(net.sf.saxon.om.NodeInfo nodeInfo)
Compares current object with specified for order. ThrowsUnsupportedOperationException
because functionality not required here.- Parameters:
nodeInfo
- anotherNodeInfo
object- Returns:
- number representing order of current object to specified one
-
getAttributeValue
public String getAttributeValue(net.sf.saxon.om.NamespaceUri namespace, String localPart)
Returns attribute value. ThrowsUnsupportedOperationException
because root node has no attributes.- Parameters:
namespace
- namespacelocalPart
- actual name of the attribute- Returns:
- attribute value
-
getLocalPart
public String getLocalPart()
Returns local part.- Returns:
- local part
-
getNodeKind
public int getNodeKind()
Returns type of the node.- Returns:
- node kind
-
getParent
public net.sf.saxon.om.NodeInfo getParent()
Returns parent.- Returns:
- parent
-
getRoot
public net.sf.saxon.om.NodeInfo getRoot()
Returns root of the tree.- Returns:
- root of the tree
-
iterateAxis
public net.sf.saxon.tree.iter.AxisIterator iterateAxis(int axisNumber)
Determines axis iteration algorithm. ThrowsUnsupportedOperationException
in case, when there is no axis iterator for given axisNumber.- Parameters:
axisNumber
- element fromAxisInfo
- Returns:
AxisIterator
object
-
getDepth
public int getDepth()
Getter method for node depth.- Specified by:
getDepth
in classAbstractNode
- Returns:
- always
0
-
throwUnsupportedOperationException
private static UnsupportedOperationException throwUnsupportedOperationException()
Returns UnsupportedOperationException exception.- Returns:
- UnsupportedOperationException exception
-
-