Class FilterHelpAppendable

  • All Implemented Interfaces:
    java.lang.Appendable, HelpAppendable
    Direct Known Subclasses:
    TextHelpAppendable

    public abstract class FilterHelpAppendable
    extends java.lang.Object
    implements HelpAppendable
    An abstract implementation of HelpAppendable that writes output to an Appendable instance.

    This class is the superclass of all classes that filter help appendables. These appendable sit on top of an existing appendable (the underlying appendable) which it uses as its basic sink of data, but possibly transforming the data along the way or providing additional functionality.

    The class FilterHelpAppendable itself simply overrides all methods of HelpAppendable with versions that pass all requests to the underlying appendable. Subclasses of FilterHelpAppendable may further override some of these methods as well as provide additional methods and fields.

    Implementation Note: This class is similar to FilterOutputStream in relation to OutputStream. We could further split FilterHelpAppendable into a FilterAppendable but that seems like YAGNI.

    Since:
    1.10.0
    • Field Detail

      • output

        protected final java.lang.Appendable output
        The underlying appendable to be filtered.
    • Constructor Detail

      • FilterHelpAppendable

        protected FilterHelpAppendable​(java.lang.Appendable output)
        Constructs an appendable filter built on top of the specified underlying appendable.
        Parameters:
        output - the underlying appendable to be assigned to the field this.output for later use, or null if this instance is to be created without an underlying stream.
    • Method Detail

      • append

        public FilterHelpAppendable append​(char ch)
                                    throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Throws:
        java.io.IOException
      • append

        public FilterHelpAppendable append​(java.lang.CharSequence text)
                                    throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Throws:
        java.io.IOException
      • append

        public FilterHelpAppendable append​(java.lang.CharSequence csq,
                                           int start,
                                           int end)
                                    throws java.io.IOException
        Specified by:
        append in interface java.lang.Appendable
        Throws:
        java.io.IOException