Package org.apache.juneau.html
Class HtmlWriter
java.lang.Object
java.io.Writer
org.apache.juneau.serializer.SerializerWriter
org.apache.juneau.xml.XmlWriter
org.apache.juneau.html.HtmlWriter
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
- Direct Known Subclasses:
- SimpleHtmlWriter
Specialized writer for serializing HTML.
 
See Also:
- 
Field SummaryFields inherited from class org.apache.juneau.serializer.SerializerWritermaxIndent, out, quoteChar, trimStrings, uriResolver, useWhitespace
- 
Constructor SummaryConstructorsConstructorDescriptionHtmlWriter(Writer out, boolean useWhitespace, int maxIndent, boolean trimStrings, char quoteChar, UriResolver uriResolver) Constructor.Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionappend(char c) append(int indent, char c) Writes an indent (if theuseWhitespacesetting is enabled), followed by text.Writes an indent (if theuseWhitespacesetting is enabled), followed by text.Writes the specified text to the writer if it isn'tnull .Writes the specified text to the writer if it isn'tnull .Writes an indent (if theuseWhitespacesetting is enabled), followed by text, followed by a newline (if theuseWhitespacesetting is enabled).Writes the specified text followed by a newline (if theuseWhitespacesetting is enabled).Shortcut forattr(null , name, value,false );Shortcut forattr(null , name, value,false );Shortcut forattr(ns, name, value,false );Writes an attribute to the output:ns:name ='value' cr(int depth) Performs a carriage return.cre(int depth) Performs a carriage return at the end of a line.Shortcut fori(indent).eTag(null , name,false );Shortcut fori(indent).eTag(ns, name,false );Shortcut fori(indent).eTag(ns, name, needsEncoding); Shortcut foreTag(null , name,false );Shortcut foreTag(ns, name,false );Writes an end tag to the output:</ns:name> i(int indent) Writes an indent to the writer if theuseWhitespacesetting is enabled.nl(int indent) Writes a newline to the writer if theuseWhitespacesetting is enabled.Writes an open-ended attribute to the output:ns:name =Shortcut fori(indent).oTag(null , name,false );Shortcut fori(indent).oTag(ns, name,false );Shortcut fori(indent).oTag(ns, name, needsEncoding); Shortcut foroTag(null , name,false );Shortcut foroTag(ns, name,false );Writes an opening tag to the output:<ns:name q()Adds the quote character specified by thequoteCharsetting to the output.s()Adds a whitespace character to the output if theuseWhitespacesetting is enabled.Shortcut fori(indent).sTag(null , name,false );Shortcut fori(indent).sTag(ns, name,false );Shortcut fori(indent).sTag(ns, name, needsEncoding); Shortcut forsTag(null , name,false );Shortcut forsTag(ns, name,false );Writes a start tag to the output:<ns:name> Shortcut fori(indent).tag(null , name,false );Shortcut fori(indent).tag(ns, name,false );Shortcut fori(indent).tag(ns, name, needsEncoding); Shortcut fortag(null , name,false );Shortcut fortag(ns, name,false );Writes a closed tag to the output:<ns:name/> Serializes and encodes the specified object as valid XML text.Methods inherited from class org.apache.juneau.xml.XmlWriterattr, attrUri, attrUri, attrUri, ceTag, cTag, ie, oAttr, text, textUri, toString, w, w
- 
Constructor Details- 
HtmlWriterpublic HtmlWriter(Writer out, boolean useWhitespace, int maxIndent, boolean trimStrings, char quoteChar, UriResolver uriResolver) Constructor.- Parameters:
- out- The writer being wrapped.
- useWhitespace- If- true , tabs will be used in output.
- maxIndent- The maximum indentation level.
- trimStrings- If- true , strings should be trimmed before they're serialized.
- quoteChar- The quote character to use (i.e.- '\'' or- '"' )
- uriResolver- The URI resolver for resolving URIs to absolute or root-relative form.
 
- 
HtmlWriterCopy constructor.- Parameters:
- w- Writer being copied.
 
 
- 
- 
Method Details- 
textDescription copied from class:XmlWriterSerializes and encodes the specified object as valid XML text.- Overrides:
- textin class- XmlWriter
- Parameters:
- o- The object being serialized.
- preserveWhitespace- If- true , then we're serializing- XmlFormat.MIXED_PWSor- XmlFormat.TEXT_PWScontent.
- Returns:
- This object.
 
- 
oTagDescription copied from class:XmlWriterWrites an opening tag to the output:<ns:name 
- 
oTagDescription copied from class:XmlWriterShortcut foroTag(ns, name,false );
- 
oTagDescription copied from class:XmlWriterShortcut foroTag(null , name,false );
- 
oTagDescription copied from class:XmlWriterShortcut fori(indent).oTag(ns, name, needsEncoding); 
- 
oTagDescription copied from class:XmlWriterShortcut fori(indent).oTag(ns, name,false );
- 
oTagDescription copied from class:XmlWriterShortcut fori(indent).oTag(null , name,false );
- 
tagDescription copied from class:XmlWriterWrites a closed tag to the output:<ns:name/> 
- 
tagDescription copied from class:XmlWriterShortcut fortag(ns, name,false );
- 
tagDescription copied from class:XmlWriterShortcut fortag(null , name,false );
- 
tagDescription copied from class:XmlWriterShortcut fori(indent).tag(null , name,false );
- 
tagDescription copied from class:XmlWriterShortcut fori(indent).tag(ns, name, needsEncoding); 
- 
tagDescription copied from class:XmlWriterShortcut fori(indent).tag(ns, name,false );
- 
sTagDescription copied from class:XmlWriterShortcut forsTag(ns, name,false );
- 
sTagDescription copied from class:XmlWriterWrites a start tag to the output:<ns:name> 
- 
sTagDescription copied from class:XmlWriterShortcut fori(indent).sTag(ns, name,false );
- 
sTagDescription copied from class:XmlWriterShortcut fori(indent).sTag(null , name,false );
- 
sTagDescription copied from class:XmlWriterShortcut forsTag(null , name,false );
- 
sTagDescription copied from class:XmlWriterShortcut fori(indent).sTag(ns, name, needsEncoding); 
- 
eTagDescription copied from class:XmlWriterShortcut foreTag(ns, name,false );
- 
eTagDescription copied from class:XmlWriterWrites an end tag to the output:</ns:name> 
- 
eTagDescription copied from class:XmlWriterShortcut fori(indent).eTag(ns, name,false );
- 
eTagDescription copied from class:XmlWriterShortcut fori(indent).eTag(null , name,false );
- 
eTagDescription copied from class:XmlWriterShortcut foreTag(null , name,false );
- 
eTagDescription copied from class:XmlWriterShortcut fori(indent).eTag(ns, name, needsEncoding); 
- 
attrDescription copied from class:XmlWriterShortcut forattr(null , name, value,false );
- 
attrDescription copied from class:XmlWriterShortcut forattr(ns, name, value,false );
- 
attrDescription copied from class:XmlWriterWrites an attribute to the output:ns:name ='value' 
- 
attrDescription copied from class:XmlWriterShortcut forattr(null , name, value,false );
- 
oAttrDescription copied from class:XmlWriterWrites an open-ended attribute to the output:ns:name =
- 
crDescription copied from class:SerializerWriterPerforms a carriage return.Adds a newline and the specified number of tabs (if the useWhitespacesetting is enabled) to the output.
- 
creDescription copied from class:SerializerWriterPerforms a carriage return at the end of a line.Adds a newline and the specified number of tabs (if the useWhitespacesetting is enabled) to the output.
- 
appendlnDescription copied from class:SerializerWriterWrites an indent (if theuseWhitespacesetting is enabled), followed by text, followed by a newline (if theuseWhitespacesetting is enabled).
- 
appendlnDescription copied from class:SerializerWriterWrites the specified text followed by a newline (if theuseWhitespacesetting is enabled).
- 
appendDescription copied from class:SerializerWriterWrites an indent (if theuseWhitespacesetting is enabled), followed by text.
- 
appendDescription copied from class:SerializerWriterWrites an indent (if theuseWhitespacesetting is enabled), followed by text.
- 
sDescription copied from class:SerializerWriterAdds a whitespace character to the output if theuseWhitespacesetting is enabled.
- 
qDescription copied from class:SerializerWriterAdds the quote character specified by thequoteCharsetting to the output.
- 
iDescription copied from class:SerializerWriterWrites an indent to the writer if theuseWhitespacesetting is enabled.
- 
nlDescription copied from class:SerializerWriterWrites a newline to the writer if theuseWhitespacesetting is enabled.
- 
appendDescription copied from class:SerializerWriterWrites the specified text to the writer if it isn'tnull .
- 
appendDescription copied from class:SerializerWriterWrites the specified text to the writer if it isn'tnull .
- 
append- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- XmlWriter
 
 
-