public class XmlPrinter extends CommonXmlWriter
XmlBuilderCDATA_BEG, CDATA_END, COMMENT_BEG, COMMENT_END, FORWARD_SLASH, CHAR_NEW_LINE, CHAR_SPACE, indentationEnabled, indentationSpace, out, XML_2QUOT, XML_AMPERSAND, XML_APOSTROPHE, XML_GT, XML_LT| Constructor and Description |
|---|
XmlPrinter()
Default constructor a zero offset
|
XmlPrinter(Appendable out)
Writer constructor with a zero offset
|
XmlPrinter(Appendable out,
String indentationSpace,
T... prefix)
A writer constructor
|
| Modifier and Type | Method and Description |
|---|---|
XmlBuilder |
createElement(String elementName)
Create any element
|
XmlBuilder |
createHtmlElement()
Create new
html element |
static XmlPrinter |
forHtml()
Crete a new instance including a DOCTYPE.
|
static XmlPrinter |
forHtml(Appendable out)
Crete a new instance including a DOCTYPE
|
static XmlPrinter |
forHtml(Object httpServletResponse)
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 |
forXml()
Crete a new instance including a XML_HEADER.
|
static XmlPrinter |
forXml(boolean indentation)
Crete a new instance with no header.
|
String |
toString() |
protected void |
writeRawValue(Object rawValue,
XmlBuilder element)
Write the content of an envelope
|
createWriter, write, writeNewLine, writeRawValue, writeValuepublic XmlPrinter()
public XmlPrinter(@Nonnull Appendable out)
public XmlPrinter(@Nonnull Appendable out, @Nullable String indentationSpace, @Nonnull T... prefix)
out - A writerindentationSpace - String for a one level offset.protected 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 CommonXmlWriterpublic XmlBuilder createHtmlElement() throws IOException
html elementIOExceptionpublic XmlBuilder createElement(@Nonnull String elementName) throws IOException
IOExceptionpublic static XmlPrinter forXml()
toString()public static XmlPrinter forXml(boolean indentation)
toString()indentation - An intendation by four spaces.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
IOExceptionpublic static XmlPrinter forNiceHtml(@Nonnull Object httpServletResponse) throws IOException
IOExceptionpublic static XmlPrinter forHtml(@Nonnull Object httpServletResponse, @Nonnull Charset charset, String indentationSpace, boolean noCache) throws IOException
IOExceptionCopyright 2015, Pavel Ponec