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.lib.ActiveSource,net.sf.saxon.om.GNode,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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAttributeNode(String name, String value) Creates a newAttributeNodeinstance. -
Method Summary
Modifier and TypeMethodDescriptionnet.sf.saxon.om.AtomicSequenceatomize()Returns AtomicSequence.intcompareOrder(net.sf.saxon.om.GNode other) Compares current object with specified for order.protected List<AbstractNode> Creates nodes for children.getAttributeValue(net.sf.saxon.om.NamespaceUri namespace, String localPart) Returns attribute value.intReturns column number.intgetDepth()Getter method for node depth.intReturns line number.Returns local part.intReturns type of the node.net.sf.saxon.om.NodeInfoReturns parent.net.sf.saxon.om.NodeInfogetRoot()Returns root.Returns string value.intGetter method for token type.Returns underlying node.booleanDetermine whether the node has any children.net.sf.saxon.om.SequenceIteratoriterateChildAxis(net.sf.saxon.pattern.nodetest.NodePredicate predicate) Child axis.net.sf.saxon.om.SequenceIteratoriterateFollowingSiblingAxis(net.sf.saxon.pattern.nodetest.NodePredicate predicate) Following-sibling axis.net.sf.saxon.om.SequenceIteratoriteratePrecedingSiblingAxis(net.sf.saxon.pattern.nodetest.NodePredicate predicate) Preceding-sibling axis.private static UnsupportedOperationExceptionReturns UnsupportedOperationException exception.Methods inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractNode
copy, filter, generateId, getAllNamespaces, getBaseURI, getChildren, getConfiguration, getDeclaredNamespaces, getDisplayName, getFingerprint, getNamespaceUri, getPrefix, getPublicId, getSchemaType, getSystemId, getTreeInfo, getUnicodeStringValue, getURI, hasFingerprint, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, saveLocation, setSystemIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.om.GNode
iterateAncestorAxis, iterateAncestorOrSelfAxis, iterateAttributeAxis, iterateDescendantAxis, iterateDescendantOrSelfAxis, iterateFollowingAxis, iterateFollowingOrSelfAxis, iterateFollowingSiblingOrSelfAxis, iterateNamespaceAxis, iterateParentAxis, iteratePrecedingAxis, iteratePrecedingOrSelfAxis, iteratePrecedingSiblingOrSelfAxis, iterateSelfAxisMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
getLabel, getLength, head, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.NodeInfo
asActiveSource, attributes, children, children, deliver, equals, getGenre, getQName, hashCode, toShortStringMethods 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 newAttributeNodeinstance.- Parameters:
name- name of the attributevalue- value of the attribute
-
-
Method Details
-
compareOrder
Compares current object with specified for order. ThrowsUnsupportedOperationExceptionbecause functionality not required here.- Parameters:
other- anotherGNodeobject- Returns:
- number representing order of current object to specified one
-
getAttributeValue
Returns attribute value. ThrowsUnsupportedOperationExceptionbecause attribute node has no attributes.- Parameters:
namespace- namespacelocalPart- actual name of the attribute- Returns:
- attribute value
-
getLocalPart
Returns local part.- Returns:
- local part
-
getNodeKind
Returns type of the node.- Returns:
- node kind
-
atomize
Description copied from class:AbstractNodeReturns AtomicSequence. ThrowsUnsupportedOperationException, because no child class implements it and this method is not used for querying.- Specified by:
atomizein interfacenet.sf.saxon.om.Item- Specified by:
atomizein interfacenet.sf.saxon.om.NodeInfo- Overrides:
atomizein classAbstractNode- Returns:
- AtomicSequence
-
getParent
Returns parent. Never called for attribute node, throwsUnsupportedOperationException. has no attributes.- Returns:
- parent
-
getRoot
Returns root. Never called for attribute node, throwsUnsupportedOperationException.- Returns:
- root
-
getStringValue
Returns string value.- Specified by:
getStringValuein interfacenet.sf.saxon.om.GroundedValue- Specified by:
getStringValuein interfacenet.sf.saxon.om.Item- Overrides:
getStringValuein classAbstractNode- Returns:
- string value
-
iterateChildAxis
public net.sf.saxon.om.SequenceIterator iterateChildAxis(net.sf.saxon.pattern.nodetest.NodePredicate predicate) Child axis. Attribute node has no children, throwsUnsupportedOperationException.- Parameters:
predicate- filter for the iterator, may be null- Returns:
- never
-
iterateFollowingSiblingAxis
public net.sf.saxon.om.SequenceIterator iterateFollowingSiblingAxis(net.sf.saxon.pattern.nodetest.NodePredicate predicate) Following-sibling axis. Attribute node can not be iterated, throwsUnsupportedOperationException.- Parameters:
predicate- filter for the iterator, may be null- Returns:
- never
-
iteratePrecedingSiblingAxis
public net.sf.saxon.om.SequenceIterator iteratePrecedingSiblingAxis(net.sf.saxon.pattern.nodetest.NodePredicate predicate) Preceding-sibling axis. Attribute node can not be iterated, throwsUnsupportedOperationException.- Parameters:
predicate- filter for the iterator, may be null- Returns:
- never
-
getLineNumber
Returns line number. Attribute node has no line number, throwsUnsupportedOperationException.- Returns:
- line number
-
getColumnNumber
Returns column number. Attribute node has no column number, throwsUnsupportedOperationException.- Returns:
- column number
-
getTokenType
Getter method for token type. Attribute node has no token type, throwsUnsupportedOperationException.- Specified by:
getTokenTypein classAbstractNode- Returns:
- token type
-
getUnderlyingNode
Returns underlying node. Attribute node has no underlying node, throwsUnsupportedOperationException.- Specified by:
getUnderlyingNodein classAbstractNode- Returns:
- underlying node
-
getDepth
Getter method for node depth. This method is not applicable to attribute nodes, throws unsupported exception.- Specified by:
getDepthin classAbstractNode- Returns:
- never
-
createChildren
Creates nodes for children. Attribute node has no children, so this method throws unsupported exception.- Specified by:
createChildrenin classAbstractNode- Returns:
- never
-
hasChildNodes
Determine whether the node has any children.- Returns:
- always
false
-
throwUnsupportedOperationException
Returns UnsupportedOperationException exception.- Returns:
- UnsupportedOperationException exception
-