Class AttributeNode
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.xpath.AbstractNode
-
- com.puppycrawl.tools.checkstyle.xpath.AttributeNode
-
- All Implemented Interfaces:
Iterable
,Source
,SourceLocator
,net.sf.saxon.expr.parser.Location
,net.sf.saxon.om.GroundedValue
,net.sf.saxon.om.Item
,net.sf.saxon.om.NodeInfo
,net.sf.saxon.om.Sequence
,Locator
public class AttributeNode extends AbstractNode
Represents attribute of the element.
-
-
Constructor Summary
Constructors Constructor Description AttributeNode(String name, String value)
Creates a newAttributeNode
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAttributeValue(String namespace, String localPart)
Returns attribute value.int
getColumnNumber()
Returns column number.int
getLineNumber()
Returns line number.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.String
getStringValue()
Returns string value.int
getTokenType()
Getter method for token type.DetailAST
getUnderlyingNode()
Returns underlying node.net.sf.saxon.tree.iter.AxisIterator
iterateAxis(byte axisNumber)
Determines axis iteration algorithm.-
Methods inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractNode
addChild, atomize, compareOrder, copy, generateId, getBaseURI, getChildren, getConfiguration, getDeclaredNamespaces, getDisplayName, getFingerprint, getPrefix, getPublicId, getSchemaType, getStringValueCS, getSystemId, getTreeInfo, getURI, hasChildNodes, hasFingerprint, head, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, iterate, 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, effectiveBooleanValue, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getLength, itemAt, iterator, reduce, subsequence
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getAttributeValue
public String getAttributeValue(String namespace, String localPart)
Returns attribute value. ThrowsUnsupportedOperationException
because attribute 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. Never called for attribute node, throwsUnsupportedOperationException
. has no attributes.- Returns:
- parent
-
getRoot
public net.sf.saxon.om.NodeInfo getRoot()
Returns root. Never called for attribute node, throwsUnsupportedOperationException
.- Returns:
- root
-
getStringValue
public String getStringValue()
Returns string value.- Returns:
- string value
-
iterateAxis
public net.sf.saxon.tree.iter.AxisIterator iterateAxis(byte axisNumber)
Determines axis iteration algorithm. Attribute node can not be iterated, throwsUnsupportedOperationException
.- Parameters:
axisNumber
- element fromAxisInfo
- Returns:
AxisIterator
object
-
getLineNumber
public int getLineNumber()
Returns line number. Attribute node has no line number, throwsUnsupportedOperationException
.- Returns:
- line number
-
getColumnNumber
public int getColumnNumber()
Returns column number. Attribute node has no column number, throwsUnsupportedOperationException
.- Returns:
- column number
-
getTokenType
public int getTokenType()
Getter method for token type. Attribute node has no token type, throwsUnsupportedOperationException
.- Specified by:
getTokenType
in classAbstractNode
- Returns:
- token type
-
getUnderlyingNode
public DetailAST getUnderlyingNode()
Returns underlying node. Attribute node has no underlying node, throwsUnsupportedOperationException
.- Specified by:
getUnderlyingNode
in classAbstractNode
- Returns:
- underlying node
-
-