public class XmlPrinter extends AbstractWriter
XmlBuilder
CDATA_BEG, CDATA_END, COMMENT_BEG, COMMENT_END, config, FORWARD_SLASH, HTML_DOCTYPE, CHAR_SPACE, indentationEnabled, out, XML_2QUOT, XML_AMPERSAND, XML_APOSTROPHE, XML_GT, XML_HEADER, XML_LT
Constructor and Description |
---|
XmlPrinter()
Default constructor a zero offset
|
XmlPrinter(Appendable out)
Writer constructor with a zero offset
|
XmlPrinter(Appendable out,
XmlConfig config)
A writer constructor
|
Modifier and Type | Method and Description |
---|---|
XmlBuilder |
createElement(String elementName)
Create any element
|
static XmlPrinter |
forHtml()
Crete a new instance including a DOCTYPE.
|
static XmlPrinter |
forHtml(Appendable out)
Crete a new instance including a DOCTYPE
|
static <T> XmlPrinter |
forHtml(Appendable out,
HtmlConfig config)
Create XmlPrinter for UTF-8
|
static XmlPrinter |
forHtml(Object httpServletResponse)
Create XmlPrinter for UTF-8
|
static XmlPrinter |
forHtml(Object httpServletResponse,
HtmlConfig config)
Create XmlPrinter for UTF-8.
|
static XmlPrinter |
forHtml(Object httpServletResponse,
Charset charset,
String indentationSpace,
boolean noCache)
Create XmlPrinter for UTF-8
|
static XmlPrinter |
forNiceHtml(Appendable out)
Crete a new instance including a DOCTYPE
|
static XmlPrinter |
forNiceHtml(Object httpServletResponse)
Create XmlPrinter for UTF-8
|
static XmlPrinter |
forNiceXml()
Crete a new instance with a formatted output.
|
static XmlPrinter |
forXml()
Crete a new instance including a XML_HEADER.
|
static XmlPrinter |
forXml(Appendable out,
XmlConfig config)
A basic XmlPrinter factory method.
|
String |
toString() |
protected void |
writeRawValue(Object rawValue,
XmlBuilder element)
Write the content of an envelope
|
createWriter, write, writeNewLine, writeRawValue, writeValue
public XmlPrinter()
public XmlPrinter(@Nonnull Appendable out)
public XmlPrinter(@Nonnull Appendable out, @Nonnull XmlConfig config)
out
- A writerconfig
- A configuration objectprotected void writeRawValue(@Nonnull Object rawValue, @Nonnull XmlBuilder element) throws IOException
rawValue
- A raw value to printelement
- An original elementIOException
@Nonnull public String toString()
toString
in class AbstractWriter
public XmlBuilder createElement(@Nonnull String elementName) throws IOException
IOException
public static XmlPrinter forXml()
toString()
public static XmlPrinter forNiceXml()
toString()
public static XmlPrinter forXml(@Nullable Appendable out, @Nonnull XmlConfig config)
toString()
public static XmlPrinter forHtml()
toString()
public static XmlPrinter forHtml(Appendable out)
public static XmlPrinter forNiceHtml(Appendable out)
public static XmlPrinter forHtml(@Nonnull Object httpServletResponse) throws IOException
IOException
public static XmlPrinter forNiceHtml(@Nonnull Object httpServletResponse) throws IOException
IOException
public static <T> XmlPrinter forHtml(@Nullable Appendable out, @Nonnull HtmlConfig config)
public static XmlPrinter forHtml(@Nonnull Object httpServletResponse, @Nonnull Charset charset, @Nonnull String indentationSpace, boolean noCache) throws IOException
IOException
public static XmlPrinter forHtml(@Nonnull Object httpServletResponse, @Nonnull HtmlConfig config) throws IOException
IOException
Copyright 2019-2022, Pavel Ponec