Class ElementNode
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.xpath.AbstractNode
-
- com.puppycrawl.tools.checkstyle.xpath.ElementNode
-
- All Implemented Interfaces:
java.lang.Iterable<net.sf.saxon.om.NodeInfo>,javax.xml.transform.Source,javax.xml.transform.SourceLocator,net.sf.saxon.expr.parser.Location,net.sf.saxon.om.GroundedValue<net.sf.saxon.om.NodeInfo>,net.sf.saxon.om.Item<net.sf.saxon.om.NodeInfo>,net.sf.saxon.om.NodeInfo,net.sf.saxon.om.Sequence<net.sf.saxon.om.NodeInfo>,org.xml.sax.Locator
public class ElementNode extends AbstractNode
Represents element node of Xpath-tree.
-
-
Constructor Summary
Constructors Constructor Description ElementNode(AbstractNode root, AbstractNode parent, DetailAST detailAst)Creates a newElementNodeinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareOrder(net.sf.saxon.om.NodeInfo other)Compares current object with specified for order.java.lang.StringgetAttributeValue(java.lang.String namespace, java.lang.String localPart)Returns attribute value.intgetColumnNumber()Returns column number.intgetLineNumber()Returns line number.java.lang.StringgetLocalPart()Returns local part.intgetNodeKind()Returns type of the node.net.sf.saxon.om.NodeInfogetParent()Returns parent.net.sf.saxon.om.NodeInfogetRoot()Returns root.intgetTokenType()Getter method for token type.DetailASTgetUnderlyingNode()Returns underlying node.net.sf.saxon.tree.iter.AxisIteratoriterateAxis(byte axisNumber)Determines axis iteration algorithm.-
Methods inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractNode
addChild, atomize, copy, generateId, getBaseURI, getChildren, getConfiguration, getDeclaredNamespaces, getDepth, getDisplayName, getFingerprint, getPrefix, getPublicId, getSchemaType, getStringValue, getStringValueCS, getSystemId, getTreeInfo, getURI, hasChildNodes, hasFingerprint, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, iterateAxis, saveLocation, setDepth, 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, effectiveBooleanValue, materialize
-
-
-
-
Constructor Detail
-
ElementNode
public ElementNode(AbstractNode root, AbstractNode parent, DetailAST detailAst)
Creates a newElementNodeinstance.- Parameters:
root-Noderoot of the treeparent-Nodeparent of the current nodedetailAst- reference toDetailAST
-
-
Method Detail
-
compareOrder
public int compareOrder(net.sf.saxon.om.NodeInfo other)
Compares current object with specified for order.- Parameters:
other- anotherNodeInfoobject- Returns:
- number representing order of current object to specified one
-
getAttributeValue
public java.lang.String getAttributeValue(java.lang.String namespace, java.lang.String localPart)Returns attribute value. ThrowsUnsupportedOperationExceptionin case, when name of the attribute is not equal to 'text'.- Parameters:
namespace- namespacelocalPart- actual name of the attribute- Returns:
- attribute value
-
getLocalPart
public java.lang.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.- Returns:
- root
-
iterateAxis
public net.sf.saxon.tree.iter.AxisIterator iterateAxis(byte axisNumber)
Determines axis iteration algorithm. ThrowsUnsupportedOperationExceptionin case, when there is no axis iterator for given axisNumber.- Parameters:
axisNumber- element fromAxisInfo- Returns:
AxisIteratorobject
-
getLineNumber
public int getLineNumber()
Returns line number.- Returns:
- line number
-
getColumnNumber
public int getColumnNumber()
Returns column number.- Returns:
- column number
-
getTokenType
public int getTokenType()
Getter method for token type.- Specified by:
getTokenTypein classAbstractNode- Returns:
- token type
-
getUnderlyingNode
public DetailAST getUnderlyingNode()
Returns underlying node.- Specified by:
getUnderlyingNodein classAbstractNode- Returns:
- underlying node
-
-