public class XmlPrinter extends AbstractWriter
XmlBuilderCDATA_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 and Description |
|---|
XmlPrinter()
Default constructor a zero offset
|
XmlPrinter(@NotNull Appendable out)
Writer constructor with a zero offset
|
XmlPrinter(@NotNull Appendable out,
@Nullable XmlConfig config)
A writer constructor
|
| Modifier and Type | Method and Description |
|---|---|
XmlBuilder |
createElement(@NotNull String name)
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(@Nullable Appendable out,
@NotNull HtmlConfig config)
Create XmlPrinter for UTF-8
|
static XmlPrinter |
forHtml(@NotNull Object httpServletResponse)
Create XmlPrinter for UTF-8
|
static XmlPrinter |
forHtml(@NotNull Object httpServletResponse,
@NotNull HtmlConfig config)
Create XmlPrinter for UTF-8.
|
static XmlPrinter |
forHtml(@NotNull Object httpServletResponse,
@NotNull Charset charset,
@NotNull String indentationSpace,
boolean noCache)
Create XmlPrinter for UTF-8
|
static XmlPrinter |
forNiceHtml(Appendable out)
Crete a new instance including a DOCTYPE
|
static XmlPrinter |
forNiceHtml(@NotNull 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(@Nullable Appendable out,
@NotNull XmlConfig config)
A basic XmlPrinter factory method.
|
@NotNull String |
toString() |
protected void |
writeRawValue(@NotNull Object rawValue,
@NotNull XmlBuilder element)
Write the content of an envelope
|
createWriter, getWriter, getWriterEscaped, write, writeNewLine, writeRawValue, writeValuepublic XmlPrinter()
public XmlPrinter(@NotNull
@NotNull Appendable out)
public XmlPrinter(@NotNull
@NotNull Appendable out,
@Nullable
@Nullable XmlConfig config)
out - A writerconfig - A configuration objectprotected void writeRawValue(@NotNull
@NotNull Object rawValue,
@NotNull
@NotNull XmlBuilder element)
throws IOException
rawValue - A raw value to printelement - An original elementIOException@NotNull public @NotNull String toString()
toString in class AbstractWriterpublic XmlBuilder createElement(@NotNull @NotNull String name) throws IOException
IOExceptionpublic static XmlPrinter forXml()
toString()public static XmlPrinter forNiceXml()
toString()public static XmlPrinter forXml(@Nullable @Nullable Appendable out, @NotNull @NotNull XmlConfig config)
toString()public static XmlPrinter forHtml()
toString()public static XmlPrinter forHtml(Appendable out)
public static XmlPrinter forNiceHtml(Appendable out)
public static XmlPrinter forHtml(@NotNull @NotNull Object httpServletResponse) throws IOException
IOExceptionpublic static XmlPrinter forNiceHtml(@NotNull @NotNull Object httpServletResponse) throws IOException
IOExceptionpublic static <T> XmlPrinter forHtml(@Nullable @Nullable Appendable out, @NotNull @NotNull HtmlConfig config)
public static XmlPrinter forHtml(@NotNull @NotNull Object httpServletResponse, @NotNull @NotNull Charset charset, @NotNull @NotNull String indentationSpace, boolean noCache) throws IOException
IOExceptionpublic static XmlPrinter forHtml(@NotNull @NotNull Object httpServletResponse, @NotNull @NotNull HtmlConfig config) throws IOException
IOExceptionCopyright 2015, Pavel Ponec