Class FilterHelpAppendable
- java.lang.Object
-
- org.apache.commons.cli.help.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 ofHelpAppendablethat writes output to anAppendableinstance.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
FilterHelpAppendableitself simply overrides all methods ofHelpAppendablewith versions that pass all requests to the underlying appendable. Subclasses ofFilterHelpAppendablemay 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 Summary
Fields Modifier and Type Field Description protected java.lang.AppendableoutputThe underlying appendable to be filtered.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFilterHelpAppendable(java.lang.Appendable output)Constructs an appendable filter built on top of the specified underlying appendable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilterHelpAppendableappend(char ch)FilterHelpAppendableappend(java.lang.CharSequence text)FilterHelpAppendableappend(java.lang.CharSequence csq, int start, int end)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.cli.help.HelpAppendable
appendFormat, appendHeader, appendList, appendParagraph, appendParagraphFormat, appendTable, appendTitle
-
-
-
-
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 fieldthis.outputfor later use, ornullif this instance is to be created without an underlying stream.
-
-
Method Detail
-
append
public FilterHelpAppendable append(char ch) throws java.io.IOException
- Specified by:
appendin interfacejava.lang.Appendable- Throws:
java.io.IOException
-
append
public FilterHelpAppendable append(java.lang.CharSequence text) throws java.io.IOException
- Specified by:
appendin interfacejava.lang.Appendable- Throws:
java.io.IOException
-
append
public FilterHelpAppendable append(java.lang.CharSequence csq, int start, int end) throws java.io.IOException
- Specified by:
appendin interfacejava.lang.Appendable- Throws:
java.io.IOException
-
-