Interface HelpAppendable

  • All Superinterfaces:
    java.lang.Appendable
    All Known Implementing Classes:
    FilterHelpAppendable, TextHelpAppendable

    public interface HelpAppendable
    extends java.lang.Appendable
    Defines a semantic scribe. The semantic scribe appends text to an output based on the semantic meaning of the type of string. For example, a Paragraph versus a Heading.

    The representation of the semantics is dependent upon the format being output. For example, the plain text output for a paragraph may print the text followed by two line breaks, while an XHTML output would print the text surrounded by <p> and </p>.

    Note the Appendable documentation on the topics of Unicode and threading, these comments also apply here.

    Since:
    1.10.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void appendFormat​(java.lang.String format, java.lang.Object... args)
      Appends a formatted string using the specified format string and arguments.
      void appendHeader​(int level, java.lang.CharSequence text)
      Appends a header.
      void appendList​(boolean ordered, java.util.Collection<java.lang.CharSequence> list)
      Appends a list.
      void appendParagraph​(java.lang.CharSequence paragraph)
      Appends a paragraph.
      default void appendParagraphFormat​(java.lang.String format, java.lang.Object... args)
      Appends a formatted string as a paragraph.
      void appendTable​(TableDefinition table)
      Appends a table.
      void appendTitle​(java.lang.CharSequence title)
      Appends a title.
      • Methods inherited from interface java.lang.Appendable

        append, append, append
    • Method Detail

      • appendFormat

        default void appendFormat​(java.lang.String format,
                                  java.lang.Object... args)
                           throws java.io.IOException
        Appends a formatted string using the specified format string and arguments.

        Short-hand for calling:

         helpAppendable.append.(String.format(format, args));
         
        Parameters:
        format - The format string for String.format(String, Object...).
        args - Arguments to String.format(String, Object...).
        Throws:
        java.util.IllegalFormatException - See String.format(String, Object...).
        java.io.IOException - If an output error occurs.
        See Also:
        String.format(String, Object...), Formatter, Appendable.append(CharSequence)
      • appendHeader

        void appendHeader​(int level,
                          java.lang.CharSequence text)
                   throws java.io.IOException
        Appends a header.
        Parameters:
        level - the level of the header. This is equivalent to the "1", "2", or "3" in the HTML "h1", "h2", "h3" tags.
        text - the text for the header, null is a noop.
        Throws:
        java.io.IOException - If an output error occurs.
      • appendList

        void appendList​(boolean ordered,
                        java.util.Collection<java.lang.CharSequence> list)
                 throws java.io.IOException
        Appends a list.
        Parameters:
        ordered - true if the list should be ordered.
        list - the list to write, null is a noop.
        Throws:
        java.io.IOException - If an output error occurs.
      • appendParagraph

        void appendParagraph​(java.lang.CharSequence paragraph)
                      throws java.io.IOException
        Appends a paragraph.
        Parameters:
        paragraph - the paragraph to write, null is a noop.
        Throws:
        java.io.IOException - If an output error occurs.
      • appendParagraphFormat

        default void appendParagraphFormat​(java.lang.String format,
                                           java.lang.Object... args)
                                    throws java.io.IOException
        Appends a formatted string as a paragraph.
         helpAppendable.appendParagraph.(String.format(format, args));
         
        Parameters:
        format - The format string for String.format(String, Object...).
        args - Arguments to String.format(String, Object...).
        Throws:
        java.util.IllegalFormatException - See String.format(String, Object...).
        java.io.IOException - If an output error occurs.
        See Also:
        String.format(String, Object...), Formatter, Appendable.append(CharSequence)
      • appendTable

        void appendTable​(TableDefinition table)
                  throws java.io.IOException
        Appends a table.
        Parameters:
        table - the table definition to write, null is a noop.
        Throws:
        java.io.IOException - If an output error occurs.
      • appendTitle

        void appendTitle​(java.lang.CharSequence title)
                  throws java.io.IOException
        Appends a title.
        Parameters:
        title - the title to write, null is a noop.
        Throws:
        java.io.IOException - If an output error occurs.