Package org.ujorm.tools.xml.model
Class XmlWriter
java.lang.Object
org.ujorm.tools.xml.AbstractWriter
org.ujorm.tools.xml.model.XmlWriter
If you need special formatting, overwrite responsible methods.
- Since:
- 1.88
- Author:
- Pavel Ponec
- See Also:
-
Field Summary
Fields inherited from class org.ujorm.tools.xml.AbstractWriter
CDATA_BEG, CDATA_END, COMMENT_BEG, COMMENT_END, config, FORMATTER, FORWARD_SLASH, HTML_DOCTYPE, indentationEnabled, NBSP, out, SPACE, XML_2QUOT, XML_AMPERSAND, XML_APOSTROPHE, XML_GT, XML_HEADER, XML_LT -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor a zero offsetXmlWriter(@NotNull Appendable out) Writer constructor with a zero offsetXmlWriter(@NotNull Appendable out, @NotNull CharSequence indentationSpace) A writer constructor -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull XmlWriterRender the XML code without headerprotected @NotNull XmlWriterwrite(int level, @Nullable CharSequence name, @Nullable Map<String, Object> attributes, @Nullable List<Object> children, @NotNull XmlModel element) Render the XML code without headerMethods inherited from class org.ujorm.tools.xml.AbstractWriter
createWriter, getWriter, getWriterEscaped, toString, write, writeNewLine, writeRawValue, writeValue
-
Constructor Details
-
XmlWriter
public XmlWriter()Default constructor a zero offset -
XmlWriter
Writer constructor with a zero offset -
XmlWriter
A writer constructor- Parameters:
out- A writerindentationSpace- String for a one level offset.
-
-
Method Details
-
write
@NotNull public final @NotNull XmlWriter write(int level, @NotNull @NotNull XmlModel element) throws IOException Render the XML code without header- Throws:
IOException
-
write
@NotNull protected @NotNull XmlWriter write(int level, @Nullable @Nullable CharSequence name, @Nullable @Nullable Map<String, Object> attributes, @Nullable @Nullable List<Object> children, @NotNull @NotNull XmlModel element) throws IOExceptionRender the XML code without header- Parameters:
level- Element nesting level.name- Name of element where thenullis allowed for an AJAX responsesattributes- Attributes of the elementchildren- Childern of the element includingnullitemselement- Original element- Returns:
- This
- Throws:
IOException
-