Class HtmlFormattedContent

All Implemented Interfaces:
Serializable

public class HtmlFormattedContent extends AbstractElementContent

This comment is a HTML preformatted content.

Usage example:

  HtmlFormattedContent c= new HtmlFormattedContent(includeSpec, "

Hello world!

");
See Also:
  • Constructor Details

    • HtmlFormattedContent

      public HtmlFormattedContent(String data)
      Create a new content without include spec
      Parameters:
      data - the text of the comment
    • HtmlFormattedContent

      public HtmlFormattedContent(IncludeSpec includeSpec, String data)
      Create a new content.
      Parameters:
      includeSpec - the includeSpec of the content
      data - the text of the content
  • Method Details

    • getData

      public String getData()
      Returns:
      the text as it was passed to constructor or the setter.
    • setData

      public void setData(String data)
      Set new text
      Parameters:
      data - the new text
    • isInlineContent

      public boolean isInlineContent()
      Specified by:
      isInlineContent in class Content
      Returns:
      false
      See Also:
    • toString

      public String toString(String prefix)
      Description copied from class: Content
      This method is for debugging purposes.
      Overrides:
      toString in class Content
      Parameters:
      prefix - If the output has multiple lines, prefix specifies the indentation of the subsequent lines.
      Returns:
      a string representation of the content and it's internal structure.
      See Also:
    • hashCode

      public int hashCode()
      implements the contract of Object.hashCode().
      Overrides:
      hashCode in class Content
      See Also:
    • equals

      public boolean equals(Object obj)
      implements the contract of Object.equals(Object).
      Overrides:
      equals in class Content
    • renderHtmlImpl

      public void renderHtmlImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx, boolean useJavascript)
      Description copied from class: Content
      render content to HTML. This method is meant to be overriden by subclasses.
      Specified by:
      renderHtmlImpl in class Content
      Parameters:
      sb - HTML code result
      includeInfo - controls, which content to be rendered.
      ctx - render context
      useJavascript - if true, the generated HTML code will contain Javascript
      See Also:
      • de.hsh.graja.util.comment.Content#renderHtml(StringBuilder, IncludeInfo, RenderContext)
    • renderPlainImpl

      public void renderPlainImpl(StringBuilder appender, IncludeInfo includeInfo, RenderContext ctx)
      Description copied from class: Content
      render content to plain text. This method is meant to be overriden by subclasses.
      Specified by:
      renderPlainImpl in class Content
      Parameters:
      appender - plain text result
      includeInfo - controls, which content to be rendered.
      ctx - render context (unused).
      See Also: