Class ElementNode

java.lang.Object
com.puppycrawl.tools.checkstyle.xpath.AbstractNode
com.puppycrawl.tools.checkstyle.xpath.ElementNode
All Implemented Interfaces:
Iterable<net.sf.saxon.om.NodeInfo>, Source, SourceLocator, net.sf.saxon.expr.parser.Location, net.sf.saxon.om.GroundedValue<net.sf.saxon.om.NodeInfo>, net.sf.saxon.om.Item<net.sf.saxon.om.NodeInfo>, net.sf.saxon.om.NodeInfo, net.sf.saxon.om.Sequence<net.sf.saxon.om.NodeInfo>, Locator

public class ElementNode extends AbstractNode
Represents element node of Xpath-tree.
  • Constructor Details

    • ElementNode

      public ElementNode(AbstractNode root, AbstractNode parent, DetailAST detailAst)
      Creates a new ElementNode instance.
      Parameters:
      root - Node root of the tree
      parent - Node parent of the current node
      detailAst - reference to DetailAST
  • Method Details

    • compareOrder

      public int compareOrder(net.sf.saxon.om.NodeInfo other)
      Compares current object with specified for order.
      Parameters:
      other - another NodeInfo object
      Returns:
      number representing order of current object to specified one
    • getAttributeValue

      public String getAttributeValue(String namespace, String localPart)
      Returns attribute value. Throws UnsupportedOperationException in case, when name of the attribute is not equal to 'text'.
      Parameters:
      namespace - namespace
      localPart - 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.
      Returns:
      parent
    • getRoot

      public net.sf.saxon.om.NodeInfo getRoot()
      Returns root.
      Returns:
      root
    • iterateAxis

      public net.sf.saxon.tree.iter.AxisIterator iterateAxis(byte axisNumber)
      Determines axis iteration algorithm. Throws UnsupportedOperationException in case, when there is no axis iterator for given axisNumber.
      Parameters:
      axisNumber - element from AxisInfo
      Returns:
      AxisIterator object
    • getLineNumber

      public int getLineNumber()
      Returns line number.
      Returns:
      line number
    • getColumnNumber

      public int getColumnNumber()
      Returns column number.
      Returns:
      column number
    • getTokenType

      public int getTokenType()
      Getter method for token type.
      Specified by:
      getTokenType in class AbstractNode
      Returns:
      token type
    • getUnderlyingNode

      public DetailAST getUnderlyingNode()
      Returns underlying node.
      Specified by:
      getUnderlyingNode in class AbstractNode
      Returns:
      underlying node