Package org.ujorm.tools.xml.dom
Class XmlElement
java.lang.Object
org.ujorm.tools.xml.model.XmlModel
org.ujorm.tools.xml.dom.XmlElement
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,ApiElement<XmlModel>
Deprecated.
XML element model to rendering a XML file.
The main benefits are:
- secure building well-formed XML documents by the Java code
- a simple API built on a single XmlElement class
- creating XML components by a subclass is possible
- great performance and small memory footprint
How to use the class:
XmlElement root = new XmlElement("root");
root.addElement("childA")
.setAttrib("x", 1)
.setAttrib("y", 2);
root.addElement("childB")
.setAttrib("x", 3)
.setAttrib("y", 4)
.addText("A text message.");
root.addRawText("\n<rawXml/>\n");
root.addCDATA("A character data <rawXml/>");
String result = root.toString();
- Since:
- 1.86
- Author:
- Pavel Ponec
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ujorm.tools.xml.model.XmlModel
XmlModel.RawEnvelope -
Field Summary
Fields inherited from class org.ujorm.tools.xml.model.XmlModel
attributes, children, name -
Constructor Summary
ConstructorsConstructorDescriptionXmlElement(String name) Deprecated.XmlElement(String name, XmlModel parent) Deprecated. -
Method Summary
Methods inherited from class org.ujorm.tools.xml.model.XmlModel
addCDATA, addComment, addElement, addElement, addChild, addRawText, addText, addTextTemplated, close, getAttribs, getAttributes, getChildren, getName, setAttribute, toString, toWriterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ujorm.tools.xml.ApiElement
setAttrib
-
Constructor Details
-
XmlElement
Deprecated. -
XmlElement
Deprecated.
-
XmlModelrather.