Class AttributeNode
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.xpath.AbstractNode
-
- com.puppycrawl.tools.checkstyle.xpath.AttributeNode
-
- All Implemented Interfaces:
javax.xml.transform.Source,javax.xml.transform.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,org.xml.sax.Locator
public class AttributeNode extends AbstractNode
Represents attribute of the element.
-
-
Constructor Summary
Constructors Constructor Description AttributeNode(java.lang.String name, java.lang.String value)Creates a newAttributeNodeinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareOrder(net.sf.saxon.om.NodeInfo nodeInfo)Compares current object with specified for order.protected java.util.List<AbstractNode>createChildren()Creates nodes for children.java.lang.StringgetAttributeValue(java.lang.String namespace, java.lang.String localPart)Returns attribute value.intgetColumnNumber()Returns column number.intgetDepth()Getter method for node depth.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.java.lang.StringgetStringValue()Returns string value.intgetTokenType()Getter method for token type.DetailASTgetUnderlyingNode()Returns underlying node.booleanhasChildNodes()Determine whether the node has any children.net.sf.saxon.tree.iter.AxisIteratoriterateAxis(int axisNumber)Determines axis iteration algorithm.private static java.lang.UnsupportedOperationExceptionthrowUnsupportedOperationException()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
-
-
-
-
Constructor Detail
-
AttributeNode
public AttributeNode(java.lang.String name, java.lang.String value)
Creates a newAttributeNodeinstance.- Parameters:
name- name of the attributevalue- value of the attribute
-
-
Method Detail
-
compareOrder
public int compareOrder(net.sf.saxon.om.NodeInfo nodeInfo)
Compares current object with specified for order. ThrowsUnsupportedOperationExceptionbecause functionality not required here.- Parameters:
nodeInfo- 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. ThrowsUnsupportedOperationExceptionbecause attribute node has no attributes.- 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. 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 java.lang.String getStringValue()
Returns string value.- Specified by:
getStringValuein interfacenet.sf.saxon.om.GroundedValue- Specified by:
getStringValuein interfacenet.sf.saxon.om.Item- Specified by:
getStringValuein interfacenet.sf.saxon.om.NodeInfo- Overrides:
getStringValuein 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:
AxisIteratorobject
-
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:
getTokenTypein classAbstractNode- Returns:
- token type
-
getUnderlyingNode
public DetailAST getUnderlyingNode()
Returns underlying node. Attribute node has no underlying node, throwsUnsupportedOperationException.- Specified by:
getUnderlyingNodein 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:
getDepthin classAbstractNode- Returns:
- never
-
createChildren
protected java.util.List<AbstractNode> createChildren()
Creates nodes for children. Attribute node has no children, so this method throws unsupported exception.- Specified by:
createChildrenin classAbstractNode- Returns:
- never
-
hasChildNodes
public boolean hasChildNodes()
Determine whether the node has any children.- Returns:
- always
false
-
throwUnsupportedOperationException
private static java.lang.UnsupportedOperationException throwUnsupportedOperationException()
Returns UnsupportedOperationException exception.- Returns:
- UnsupportedOperationException exception
-
-