Package org.apache.commons.cli.help
Interface HelpAppendable
- All Superinterfaces:
Appendable
- All Known Implementing Classes:
FilterHelpAppendable,TextHelpAppendable
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
Modifier and TypeMethodDescriptiondefault voidappendFormat(String format, Object... args) Appends a formatted string using the specified format string and arguments.voidappendHeader(int level, CharSequence text) Appends a header.voidappendList(boolean ordered, Collection<CharSequence> list) Appends a list.voidappendParagraph(CharSequence paragraph) Appends a paragraph.default voidappendParagraphFormat(String format, Object... args) Appends a formatted string as a paragraph.voidappendTable(TableDefinition table) Appends a table.voidappendTitle(CharSequence title) Appends a title.Methods inherited from interface java.lang.Appendable
append, append, append
-
Method Details
-
appendFormat
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 forString.format(String, Object...).args- Arguments toString.format(String, Object...).- Throws:
IllegalFormatException- SeeString.format(String, Object...).IOException- If an output error occurs.- See Also:
-
appendHeader
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:
IOException- If an output error occurs.
-
appendList
Appends a list.- Parameters:
ordered-trueif the list should be ordered.list- the list to write, null is a noop.- Throws:
IOException- If an output error occurs.
-
appendParagraph
Appends a paragraph.- Parameters:
paragraph- the paragraph to write, null is a noop.- Throws:
IOException- If an output error occurs.
-
appendParagraphFormat
Appends a formatted string as a paragraph.helpAppendable.
appendParagraph.(String.format(format, args));- Parameters:
format- The format string forString.format(String, Object...).args- Arguments toString.format(String, Object...).- Throws:
IllegalFormatException- SeeString.format(String, Object...).IOException- If an output error occurs.- See Also:
-
appendTable
Appends a table.- Parameters:
table- the table definition to write, null is a noop.- Throws:
IOException- If an output error occurs.
-
appendTitle
Appends a title.- Parameters:
title- the title to write, null is a noop.- Throws:
IOException- If an output error occurs.
-