Package com.oorian.xml
Class TextNode
java.lang.Object
com.oorian.xml.TextNode
- All Implemented Interfaces:
XmlNode
Represents a text node within an XML document.
TextNode contains plain text content that appears within an XML element. Special characters are automatically escaped when the node is serialized to XML format.
- Since:
- 2020
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TextNode
Constructs a new TextNode with the specified text content.- Parameters:
text- the text content.
-
-
Method Details
-
getText
Returns the text content.- Returns:
- The text content
-
setText
Sets the text content.- Parameters:
text- The new text content
-
toXmlString
Description copied from interface:XmlNodeReturns the XML string representation of this node with the specified indentation level.- Specified by:
toXmlStringin interfaceXmlNode- Parameters:
indent- the indentation level (number of two-space indents).- Returns:
- the formatted XML string.
-
toString
-