Class Newline

  • All Implemented Interfaces:
    Serializable

    public class Newline
    extends AbstractElementContent

    This content is rendered as a <br/> inside a paragraph. A subsequent content will begin immediately after this content on a new line.

    Usage example:

    Paragraph para= new Paragraph();
    para.formatInlineItem(includeSpec, "%s: %d", "Expected result", 15);
    para.newLine(includeSpec);
    para.formatInlineItem(includeSpec, "%s: %d", "Observed result", 12);
    
    See Also:
    Serialized Form
    • Constructor Detail

      • Newline

        public Newline​(IncludeSpec includeSpec)
        Create a new content.
        Parameters:
        includeSpec - the includeSpec of the content
    • Method Detail

      • 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:
        Content#renderHtmlImpl(StringBuilder, IncludeInfo, RenderContext)