Class AttributeNode
java.lang.Object
com.puppycrawl.tools.checkstyle.xpath.AbstractNode
com.puppycrawl.tools.checkstyle.xpath.AttributeNode
- All Implemented Interfaces:
Source
,SourceLocator
,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
Represents attribute of the element.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The name of the attribute.private final String
The value of the attribute.Fields inherited from interface net.sf.saxon.om.NodeInfo
IS_DTD_TYPE, IS_NILLED
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeNode
(String name, String value) Creates a newAttributeNode
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
compareOrder
(net.sf.saxon.om.NodeInfo nodeInfo) Compares current object with specified for order.protected List
<AbstractNode> Creates nodes for children.getAttributeValue
(String namespace, String localPart) Returns attribute value.int
Returns column number.int
getDepth()
Getter method for node depth.int
Returns line number.Returns local part.int
Returns type of the node.net.sf.saxon.om.NodeInfo
Returns parent.net.sf.saxon.om.NodeInfo
getRoot()
Returns root.Returns string value.int
Getter method for token type.Returns underlying node.boolean
Determine whether the node has any children.net.sf.saxon.tree.iter.AxisIterator
iterateAxis
(int axisNumber) Determines axis iteration algorithm.private static UnsupportedOperationException
Returns UnsupportedOperationException exception.Methods inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractNode
atomize, copy, generateId, getAllNamespaces, getBaseURI, getChildren, getConfiguration, getDeclaredNamespaces, getDisplayName, getFingerprint, getPrefix, getPublicId, getSchemaType, getStringValueCS, getSystemId, getTreeInfo, 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
Methods inherited from interface net.sf.saxon.om.NodeInfo
attributes, children, children, equals, getGenre, hashCode, toShortString
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Field Details
-
name
The name of the attribute. -
value
The value of the attribute.
-
-
Constructor Details
-
AttributeNode
Creates a newAttributeNode
instance.- Parameters:
name
- name of the attributevalue
- value of the attribute
-
-
Method Details
-
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
Returns attribute value. ThrowsUnsupportedOperationException
because attribute node has no attributes.- Parameters:
namespace
- namespacelocalPart
- actual name of the attribute- Returns:
- attribute value
-
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
Returns string value.- Specified by:
getStringValue
in interfacenet.sf.saxon.om.GroundedValue
- Specified by:
getStringValue
in interfacenet.sf.saxon.om.Item
- Specified by:
getStringValue
in interfacenet.sf.saxon.om.NodeInfo
- Overrides:
getStringValue
in classAbstractNode
- Returns:
- string value
-
iterateAxis
public net.sf.saxon.tree.iter.AxisIterator iterateAxis(int 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
Returns underlying node. Attribute node has no underlying node, throwsUnsupportedOperationException
.- Specified by:
getUnderlyingNode
in classAbstractNode
- Returns:
- underlying node
-
getDepth
public int getDepth()Getter method for node depth. This method is not applicable to attribute nodes, throws unsupported exception.- Specified by:
getDepth
in classAbstractNode
- Returns:
- never
-
createChildren
Creates nodes for children. Attribute node has no children, so this method throws unsupported exception.- Specified by:
createChildren
in classAbstractNode
- Returns:
- never
-
hasChildNodes
public boolean hasChildNodes()Determine whether the node has any children.- Returns:
- always
false
-
throwUnsupportedOperationException
Returns UnsupportedOperationException exception.- Returns:
- UnsupportedOperationException exception
-