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:
    Serialized Form
    • Constructor Detail

      • 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 Detail

      • 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
      • 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:
        Content.toString(java.lang.String)
      • 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)