public class HtmlWriter extends XmlWriter
maxIndent, out, quoteChar, trimStrings, uriResolver, useWhitespace| Constructor and Description |
|---|
HtmlWriter(Writer out,
boolean useWhitespace,
int maxIndent,
boolean trimStrings,
char quoteChar,
UriResolver uriResolver)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
HtmlWriter |
append(char c) |
HtmlWriter |
append(int indent,
char c)
Writes an indent (if the
useWhitespace setting is enabled), followed by text. |
HtmlWriter |
append(int indent,
String text)
Writes an indent (if the
useWhitespace setting is enabled), followed by text. |
HtmlWriter |
append(Object text)
Writes the specified text to the writer.
|
HtmlWriter |
append(String text)
Writes the specified text to the writer.
|
HtmlWriter |
appendln(int indent,
String text)
Writes an indent (if the
useWhitespace setting is enabled), followed by text, followed by a newline
(if the useWhitespace setting is enabled). |
HtmlWriter |
appendln(String text)
Writes the specified text followed by a newline (if the
useWhitespace setting is enabled). |
HtmlWriter |
attr(String name,
Object value)
Shortcut for
attr( |
HtmlWriter |
attr(String name,
Object value,
boolean valNeedsEncoding)
Shortcut for
attr( |
HtmlWriter |
attr(String ns,
String name,
Object value)
Shortcut for
attr(ns, name, value, |
HtmlWriter |
attr(String ns,
String name,
Object value,
boolean valNeedsEncoding)
Writes an attribute to the output:
|
HtmlWriter |
cr(int depth)
Performs a carriage return.
|
HtmlWriter |
cre(int depth)
Performs a carriage return at the end of a line.
|
HtmlWriter |
eTag(int indent,
String name)
Shortcut for
i(indent).eTag( |
HtmlWriter |
eTag(int indent,
String ns,
String name)
Shortcut for
i(indent).eTag(ns, name, |
HtmlWriter |
eTag(int indent,
String ns,
String name,
boolean needsEncoding)
Shortcut for
|
HtmlWriter |
eTag(String name)
Shortcut for
eTag( |
HtmlWriter |
eTag(String ns,
String name)
Shortcut for
eTag(ns, name, |
HtmlWriter |
eTag(String ns,
String name,
boolean needsEncoding)
Writes an end tag to the output:
|
HtmlWriter |
i(int indent)
Writes an indent to the writer if the
useWhitespace setting is enabled. |
HtmlWriter |
nl(int indent)
Writes a newline to the writer if the
useWhitespace setting is enabled. |
HtmlWriter |
oAttr(String ns,
String name)
Writes an open-ended attribute to the output:
|
HtmlWriter |
oTag(int indent,
String name)
Shortcut for
i(indent).oTag( |
HtmlWriter |
oTag(int indent,
String ns,
String name)
Shortcut for
i(indent).oTag(ns, name, |
HtmlWriter |
oTag(int indent,
String ns,
String name,
boolean needsEncoding)
Shortcut for
|
HtmlWriter |
oTag(String name)
Shortcut for
oTag( |
HtmlWriter |
oTag(String ns,
String name)
Shortcut for
oTag(ns, name, |
HtmlWriter |
oTag(String ns,
String name,
boolean needsEncoding)
Writes an opening tag to the output:
|
HtmlWriter |
q()
Adds the quote character specified by the
quoteChar setting to the output. |
HtmlWriter |
s()
Adds a whitespace character to the output if the
useWhitespace setting is enabled. |
HtmlWriter |
sTag(int indent,
String name)
Shortcut for
i(indent).sTag( |
HtmlWriter |
sTag(int indent,
String ns,
String name)
Shortcut for
i(indent).sTag(ns, name, |
HtmlWriter |
sTag(int indent,
String ns,
String name,
boolean needsEncoding)
Shortcut for
|
HtmlWriter |
sTag(String name)
Shortcut for
sTag( |
HtmlWriter |
sTag(String ns,
String name)
Shortcut for
sTag(ns, name, |
HtmlWriter |
sTag(String ns,
String name,
boolean needsEncoding)
Writes a start tag to the output:
|
HtmlWriter |
tag(int indent,
String name)
Shortcut for
i(indent).tag( |
HtmlWriter |
tag(int indent,
String ns,
String name)
Shortcut for
i(indent).tag(ns, name, |
HtmlWriter |
tag(int indent,
String ns,
String name,
boolean needsEncoding)
Shortcut for
|
HtmlWriter |
tag(String name)
Shortcut for
tag( |
HtmlWriter |
tag(String ns,
String name)
Shortcut for
tag(ns, name, |
HtmlWriter |
tag(String ns,
String name,
boolean needsEncoding)
Writes a closed tag to the output:
|
HtmlWriter |
text(Object o,
boolean preserveWhitespace)
Serializes and encodes the specified object as valid XML text.
|
attr, attrUri, attrUri, attrUri, ceTag, cTag, ie, oAttr, text, textUri, toStringpublic HtmlWriter(Writer out, boolean useWhitespace, int maxIndent, boolean trimStrings, char quoteChar, UriResolver uriResolver)
out - The writer being wrapped.useWhitespace - If maxIndent - The maximum indentation level.trimStrings - If quoteChar - The quote character to use (i.e. uriResolver - The URI resolver for resolving URIs to absolute or root-relative form.public HtmlWriter text(Object o, boolean preserveWhitespace) throws IOException
XmlWritertext in class XmlWritero - The object being serialized.preserveWhitespace - If XmlFormat.MIXED_PWS or XmlFormat.TEXT_PWS content.IOException - Thrown by underlying stream.public HtmlWriter oTag(String ns, String name, boolean needsEncoding) throws IOException
XmlWriter<ns:name oTag in class XmlWriterns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter oTag(String ns, String name) throws IOException
XmlWriteroTag(ns, name, false );oTag in class XmlWriterns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter oTag(String name) throws IOException
XmlWriteroTag(null , name, false );oTag in class XmlWritername - The element name.IOException - If a problem occurred.public HtmlWriter oTag(int indent, String ns, String name, boolean needsEncoding) throws IOException
XmlWriteroTag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter oTag(int indent, String ns, String name) throws IOException
XmlWriteri(indent).oTag(ns, name, false );oTag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter oTag(int indent, String name) throws IOException
XmlWriteri(indent).oTag(null , name, false );oTag in class XmlWriterindent - The number of prefix tabs to add.name - The element name.IOException - If a problem occurred.public HtmlWriter tag(String ns, String name, boolean needsEncoding) throws IOException
XmlWriter<ns:name/> tag in class XmlWriterns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter tag(String ns, String name) throws IOException
XmlWritertag(ns, name, false );tag in class XmlWriterns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter tag(String name) throws IOException
XmlWritertag(null , name, false );tag in class XmlWritername - The element name.IOException - If a problem occurred.public HtmlWriter tag(int indent, String name) throws IOException
XmlWriteri(indent).tag(null , name, false );tag in class XmlWriterindent - The number of prefix tabs to add.name - The element name.IOException - If a problem occurred.public HtmlWriter tag(int indent, String ns, String name, boolean needsEncoding) throws IOException
XmlWritertag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter tag(int indent, String ns, String name) throws IOException
XmlWriteri(indent).tag(ns, name, false );tag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter sTag(String ns, String name) throws IOException
XmlWritersTag(ns, name, false );sTag in class XmlWriterns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter sTag(String ns, String name, boolean needsEncoding) throws IOException
XmlWriter<ns:name> sTag in class XmlWriterns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter sTag(int indent, String ns, String name) throws IOException
XmlWriteri(indent).sTag(ns, name, false );sTag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter sTag(int indent, String name) throws IOException
XmlWriteri(indent).sTag(null , name, false );sTag in class XmlWriterindent - The number of prefix tabs to add.name - The element name.IOException - If a problem occurred.public HtmlWriter sTag(String name) throws IOException
XmlWritersTag(null , name, false );sTag in class XmlWritername - The element name.IOException - If a problem occurred.public HtmlWriter sTag(int indent, String ns, String name, boolean needsEncoding) throws IOException
XmlWritersTag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter eTag(String ns, String name) throws IOException
XmlWritereTag(ns, name, false );eTag in class XmlWriterns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter eTag(String ns, String name, boolean needsEncoding) throws IOException
XmlWriter</ns:name> eTag in class XmlWriterns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter eTag(int indent, String ns, String name) throws IOException
XmlWriteri(indent).eTag(ns, name, false );eTag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.IOException - If a problem occurred.public HtmlWriter eTag(int indent, String name) throws IOException
XmlWriteri(indent).eTag(null , name, false );eTag in class XmlWriterindent - The number of prefix tabs to add.name - The element name.IOException - If a problem occurred.public HtmlWriter eTag(String name) throws IOException
XmlWritereTag(null , name, false );eTag in class XmlWritername - The element name.IOException - If a problem occurred.public HtmlWriter eTag(int indent, String ns, String name, boolean needsEncoding) throws IOException
XmlWritereTag in class XmlWriterindent - The number of prefix tabs to add.ns - The namespace. Can be name - The element name.needsEncoding - If IOException - If a problem occurred.public HtmlWriter attr(String name, Object value) throws IOException
XmlWriterattr(null , name, value, false );attr in class XmlWritername - The attribute name.value - The attribute value.IOException - If a problem occurred.public HtmlWriter attr(String ns, String name, Object value) throws IOException
XmlWriterattr(ns, name, value, false );attr in class XmlWriterns - The namespace. Can be name - The attribute name.value - The attribute value.IOException - If a problem occurred.public HtmlWriter attr(String ns, String name, Object value, boolean valNeedsEncoding) throws IOException
XmlWriterns:name ='value' attr in class XmlWriterns - The namespace. Can be name - The attribute name.value - The attribute value.valNeedsEncoding - If IOException - If a problem occurred.public HtmlWriter attr(String name, Object value, boolean valNeedsEncoding) throws IOException
XmlWriterattr(null , name, value, false );attr in class XmlWritername - The attribute name.value - The attribute value.valNeedsEncoding - If IOException - If a problem occurred.public HtmlWriter oAttr(String ns, String name) throws IOException
XmlWriterns:name =oAttr in class XmlWriterns - The namespace. Can be name - The attribute name.IOException - If a problem occurred.public HtmlWriter cr(int depth) throws IOException
SerializerWriter
Adds a newline and the specified number of tabs (if the useWhitespace setting is enabled) to the output.
cr in class XmlWriterdepth - The indentation.IOException - If a problem occurred trying to write to the writer.public HtmlWriter cre(int depth) throws IOException
SerializerWriter
Adds a newline and the specified number of tabs (if the useWhitespace setting is enabled) to the output.
cre in class XmlWriterdepth - The indentation.IOException - If a problem occurred trying to write to the writer.public HtmlWriter appendln(int indent, String text) throws IOException
SerializerWriteruseWhitespace setting is enabled), followed by text, followed by a newline
(if the useWhitespace setting is enabled).appendln in class XmlWriterindent - The number of tabs to indent.text - The text to write.IOException - If a problem occurred trying to write to the writer.public HtmlWriter appendln(String text) throws IOException
SerializerWriteruseWhitespace setting is enabled).appendln in class XmlWritertext - The text to write.IOException - If a problem occurred trying to write to the writer.public HtmlWriter append(int indent, String text) throws IOException
SerializerWriteruseWhitespace setting is enabled), followed by text.append in class XmlWriterindent - The number of tabs to indent.text - The text to write.IOException - If a problem occurred trying to write to the writer.public HtmlWriter append(int indent, char c) throws IOException
SerializerWriteruseWhitespace setting is enabled), followed by text.append in class XmlWriterindent - The number of tabs to indent.c - The character to write.IOException - If a problem occurred trying to write to the writer.public HtmlWriter s() throws IOException
SerializerWriteruseWhitespace setting is enabled.s in class XmlWriterIOException - If a problem occurred trying to write to the writer.public HtmlWriter q() throws IOException
SerializerWriterquoteChar setting to the output.q in class XmlWriterIOException - If a problem occurred trying to write to the writer.public HtmlWriter i(int indent) throws IOException
SerializerWriteruseWhitespace setting is enabled.i in class XmlWriterindent - The number of tabs to indent.IOException - If a problem occurred trying to write to the writer.public HtmlWriter nl(int indent) throws IOException
SerializerWriteruseWhitespace setting is enabled.nl in class XmlWriterindent - The current indentation level.IOException - If a problem occurred trying to write to the writer.public HtmlWriter append(Object text) throws IOException
SerializerWriterappend in class XmlWritertext - The text to write.IOException - If a problem occurred trying to write to the writer.public HtmlWriter append(String text) throws IOException
SerializerWriterappend in class XmlWritertext - The text to write.IOException - If a problem occurred trying to write to the writer.public HtmlWriter append(char c) throws IOException
append in interface Appendableappend in class XmlWriterIOExceptionCopyright © 2016–2019 The Apache Software Foundation. All rights reserved.