Class ElementNode
java.lang.Object
com.puppycrawl.tools.checkstyle.xpath.AbstractNode
com.puppycrawl.tools.checkstyle.xpath.AbstractElementNode
com.puppycrawl.tools.checkstyle.xpath.ElementNode
- All Implemented Interfaces:
Source,SourceLocator,net.sf.saxon.lib.ActiveSource,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 DetailAST's element node of Xpath-tree.
-
Field Summary
FieldsFields inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractElementNode
TEXT_ATTRIBUTE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionElementNode(AbstractNode root, AbstractNode parent, DetailAST detailAst, int depth, int indexAmongSiblings) Creates a newElementNodeinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeNodeCreatesAttributeNodeobject and returns it.protected List<AbstractNode>Iterates children of the current node and recursively creates new Xpath-nodes.intReturns column number.intReturns line number.Returns local part.intGetter method for token type.Returns underlying node.booleanDetermine whether the node has any children.Methods inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractElementNode
compareOrder, getAttributeValue, getDepth, getNodeKind, getParent, getRoot, iterateAxisMethods inherited from class com.puppycrawl.tools.checkstyle.xpath.AbstractNode
atomize, copy, generateId, getAllNamespaces, getBaseURI, getChildren, getConfiguration, getDeclaredNamespaces, getDisplayName, getFingerprint, getNamespaceUri, getPrefix, getPublicId, getSchemaType, getStringValue, getSystemId, getTreeInfo, getUnicodeStringValue, getURI, hasFingerprint, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, iterateAxis, 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.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
getLength, head, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.NodeInfo
asActiveSource, attributes, children, children, deliver, equals, getAttributeValue, getGenre, hashCode, toShortStringMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Field Details
-
detailAst
The ast node.
-
-
Constructor Details
-
ElementNode
public ElementNode(AbstractNode root, AbstractNode parent, DetailAST detailAst, int depth, int indexAmongSiblings) Creates a newElementNodeinstance.- Parameters:
root-Noderoot of the treeparent-Nodeparent of the current nodedetailAst- reference toDetailASTdepth- the current node depth in the hierarchyindexAmongSiblings- the current node index among the parent children nodes
-
-
Method Details
-
createChildren
Iterates children of the current node and recursively creates new Xpath-nodes.- Specified by:
createChildrenin classAbstractNode- Returns:
- children list
-
hasChildNodes
Determine whether the node has any children.- Returns:
trueis the node has any children.
-
getLocalPart
Returns local part.- Returns:
- local part
-
getLineNumber
Returns line number.- Returns:
- line number
-
getColumnNumber
Returns column number.- Returns:
- column number
-
getTokenType
Getter method for token type.- Specified by:
getTokenTypein classAbstractNode- Returns:
- token type
-
getUnderlyingNode
Returns underlying node.- Specified by:
getUnderlyingNodein classAbstractNode- Returns:
- underlying node
-
createAttributeNode
Description copied from class:AbstractElementNodeCreatesAttributeNodeobject and returns it.- Specified by:
createAttributeNodein classAbstractElementNode- Returns:
- attribute node if possible, otherwise the
nullvalue
-