Class NativeXmlNode
java.lang.Object
org.eolang.jeo.representation.xmir.NativeXmlNode
- All Implemented Interfaces:
XmlNode
XML smart element.
Utility class that simplifies work with XML.
- Since:
- 0.1
-
Constructor Summary
ConstructorsConstructorDescriptionNativeXmlNode(String xml) Constructor.NativeXmlNode(Node parent) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet attribute.Get child node.Get child node by attribute.children()Get all child nodes.booleanGet first child.booleanhasAttribute(String name, String value) Check if an attribute exists.inthashCode()Get optional child node by attribute.text()Retrieve node text content.toString()voidvalidate()Validate the node.Find elements by xpath.
-
Constructor Details
-
NativeXmlNode
Constructor.- Parameters:
xml- XML string.
-
NativeXmlNode
Constructor.- Parameters:
parent- Xml node.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
children
Description copied from interface:XmlNodeGet all child nodes. -
text
Description copied from interface:XmlNodeRetrieve node text content. -
attribute
Description copied from interface:XmlNodeGet attribute. -
child
Description copied from interface:XmlNodeGet child node. -
xpath
Find elements by xpath. -
child
Description copied from interface:XmlNodeGet child node by attribute. -
optchild
Description copied from interface:XmlNodeGet optional child node by attribute. -
firstChild
Description copied from interface:XmlNodeGet first child.- Specified by:
firstChildin interfaceXmlNode- Returns:
- First child node.
-
hasAttribute
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.
-
validate
public void validate()Description copied from interface:XmlNodeValidate the node.
-