Class XmlNode

java.lang.Object
com.atlassian.jira.util.xml.XmlNode

public class XmlNode extends Object
Wrapper around an XML DOM node object providing helper methods for simple parsing of XML files.
Since:
v6.4.6
  • Constructor Details

    • XmlNode

      public XmlNode(Node node)
      Create a new XmlNode wrapping the given DOM Node.
      Parameters:
      node - the DOM Node
  • Method Details

    • getNodeName

      public String getNodeName()
    • getChildren

      @Nonnull public List<XmlNode> getChildren()
    • getChildren

      @Nonnull public List<XmlNode> getChildren(String name)
      Return a list of all child nodes with the given name.
      Parameters:
      name - the node name
      Returns:
      a list of all child nodes with the given name.
    • getFirstChild

      @Nullable public XmlNode getFirstChild(String name)
      Return the first child with the given name.
      Parameters:
      name - the name
      Returns:
      the first child with the given name (or null if none exist).
    • getAttribute

      @Nullable public String getAttribute(String name)
      Return the attribute with the given name.
      Parameters:
      name - the attribute name
      Returns:
      the attribute with the given name (or null if it doesn't exist).
    • getTextContent

      public String getTextContent()
      Returns the text content of this node and its descendants.
      Returns:
      the text content of this node and its descendants.
      See Also: