Class NativeXmlNode
- java.lang.Object
-
- org.eolang.jeo.representation.xmir.NativeXmlNode
-
-
Constructor Summary
Constructors Constructor Description NativeXmlNode(String xml)Constructor.NativeXmlNode(Node parent)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>attribute(String name)Get attribute.XmlNodechild(String name)Get child node.XmlNodechild(String attribute, String value)Get child node by attribute.Stream<XmlNode>children()Get all child nodes.booleanequals(Object obj)XmlNodefirstChild()Get first child.booleanhasAttribute(String name, String value)Check if an attribute exists.inthashCode()Optional<XmlNode>optchild(String attribute, String value)Get optional child node by attribute.Stringtext()Retrieve node text content.StringtoString()voidvalidate()Validate the node.List<String>xpath(String xpath)Find elements by xpath.
-
-
-
Method Detail
-
children
public Stream<XmlNode> children()
Description copied from interface:XmlNodeGet all child nodes.
-
attribute
public Optional<String> attribute(String name)
Description copied from interface:XmlNodeGet attribute.
-
child
public XmlNode child(String attribute, String value)
Description copied from interface:XmlNodeGet child node by attribute.
-
optchild
public Optional<XmlNode> optchild(String attribute, String value)
Description copied from interface:XmlNodeGet optional child node by attribute.
-
firstChild
public XmlNode firstChild()
Description copied from interface:XmlNodeGet first child.- Specified by:
firstChildin interfaceXmlNode- Returns:
- First child node.
-
hasAttribute
public boolean hasAttribute(String name, String value)
Description copied from interface:XmlNodeCheck if an attribute exists.- Specified by:
hasAttributein interfaceXmlNode- Parameters:
name- Attribute name.value- Attribute value.- Returns:
- True if an attribute with specified value exists.
-
-