Class XmlNode

java.lang.Object
org.eolang.jeo.representation.xmir.XmlNode

public final class XmlNode extends Object
XML smart element. Utility class that simplifies work with XML.
Since:
0.1
  • Constructor Details

    • XmlNode

      public XmlNode(String xml)
      Constructor.
      Parameters:
      xml - XML string.
    • XmlNode

      public XmlNode(Node parent)
      Constructor.
      Parameters:
      parent - Parent node.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • children

      public Stream<XmlNode> children()
      Get all child nodes.
      Returns:
      Child nodes.
    • text

      public String text()
      Retrieve node text content.
      Returns:
      Text content.
    • attribute

      public Optional<String> attribute(String name)
      Get attribute.
      Parameters:
      name - Attribute name.
      Returns:
      Attribute.