Class HtmlWriter<SELF extends HtmlWriter<SELF>>

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
Direct Known Subclasses:
BasicHtmlWriter, SimpleHtmlWriter

public abstract class HtmlWriter<SELF extends HtmlWriter<SELF>> extends XmlWriter<SELF>
Specialized writer for serializing HTML.
See Also:
  • Constructor Details

    • HtmlWriter

      protected HtmlWriter(HtmlWriter<?> w)
      Copy constructor.
      Parameters:
      w - Writer being copied.
    • HtmlWriter

      protected 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.
  • Method Details

    • cr

      public SELF cr(int depth)
      Description copied from class: SerializerWriter
      Performs a carriage return.

      Adds a newline and the specified number of tabs (if the useWhitespace setting is enabled) to the output.

      Overrides:
      cr in class SerializerWriter<SELF extends HtmlWriter<SELF>>
      Parameters:
      depth - The indentation.
      Returns:
      This object.
    • cre

      public SELF cre(int depth)
      Description copied from class: SerializerWriter
      Performs a carriage return at the end of a line.

      Adds a newline and the specified number of tabs (if the useWhitespace setting is enabled) to the output.

      Overrides:
      cre in class SerializerWriter<SELF extends HtmlWriter<SELF>>
      Parameters:
      depth - The indentation.
      Returns:
      This object.
    • text

      public SELF text(Object o, boolean preserveWhitespace)
      Description copied from class: XmlWriter
      Serializes and encodes the specified object as valid XML text.
      Overrides:
      text in class XmlWriter<SELF extends HtmlWriter<SELF>>
      Parameters:
      o - The object being serialized.
      preserveWhitespace - If true, then we're serializing XmlFormat.MIXED_PWS or XmlFormat.TEXT_PWS content.
      Returns:
      This object.