public class AbstractCliParser.CliHelpWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
private Appendable |
appendable
The
Appendable where to write help to. |
private Map<String,Object> |
arguments
The NLS-arguments.
|
private TextColumnInfo |
mainColumnInfo
The
TextColumnInfo for the main column. |
private TextColumnInfo |
parameterColumnInfo
The
TextColumnInfo for parameters (e.g. |
private TextTableInfo |
tableInfo
The
TextTableInfo. |
| Constructor and Description |
|---|
CliHelpWriter(Appendable appendable,
CliOutputSettings settings)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getArguments() |
void |
printArguments(List<AbstractCliParser.CliArgumentHelpInfo> argumentList,
int maxArgumentColumnWidth)
This method prints the help for the
arguments given by argumentList. |
void |
println()
Prints a newline (terminates current line).
|
private void |
printMessage(NlsMessage message)
Prints the given
NlsMessage for the proper Locale. |
private void |
printOptions(Collection<CliOptionContainer> modeOptions,
Map<CliOption,AbstractCliParser.CliOptionHelpInfo> option2HelpMap,
boolean required)
This method is like
printOptions(Collection, Map, int) but only prints required or additional options. |
void |
printOptions(Collection<CliOptionContainer> modeOptions,
Map<CliOption,AbstractCliParser.CliOptionHelpInfo> option2HelpMap,
int maxOptionColumnWidth)
This method prints the help for the
options given by modeOptions. |
void |
printText(String nlsText)
This method performs localization of the given NLS-text (see
AbstractResourceBundle) and performs line-wrapping while
writing it to the Appendable for help-usage output. |
private final Appendable appendable
Appendable where to write help to.private final TextTableInfo tableInfo
TextTableInfo.private final TextColumnInfo parameterColumnInfo
TextColumnInfo for parameters (e.g. "--help (-h)").private final TextColumnInfo mainColumnInfo
TextColumnInfo for the main column.public CliHelpWriter(Appendable appendable, CliOutputSettings settings)
appendable - is the Appendable where to write help to.settings - is the CliOutputSettings.public void printText(String nlsText)
AbstractResourceBundle) and performs line-wrapping while
writing it to the Appendable for help-usage output.nlsText - is the internationalized text to print.private void printMessage(NlsMessage message)
NlsMessage for the proper Locale.message - the NlsMessage to print.public void printArguments(List<AbstractCliParser.CliArgumentHelpInfo> argumentList, int maxArgumentColumnWidth)
arguments given by argumentList. It prints them
with localized usage texts in a two column-layout via LineWrapper.argumentList - is the List with the according help infos.maxArgumentColumnWidth - is the maximum width of the argument-name column.public void printOptions(Collection<CliOptionContainer> modeOptions, Map<CliOption,AbstractCliParser.CliOptionHelpInfo> option2HelpMap, int maxOptionColumnWidth)
options given by modeOptions. It prints them with
localized usage texts in a two column-layout via LineWrapper.modeOptions - is the Collection with the options to print.option2HelpMap - is the Map with the according help infos.maxOptionColumnWidth - is the maximum width of the option-syntax column.private void printOptions(Collection<CliOptionContainer> modeOptions, Map<CliOption,AbstractCliParser.CliOptionHelpInfo> option2HelpMap, boolean required)
printOptions(Collection, Map, int) but only prints required or additional options.modeOptions - is the Collection with the options to print.option2HelpMap - is the Map with the according help infos.required - - true if required options should be printed, false if additional options should
be printed.public void println()
Copyright © 2001–2016 mmm-Team. All rights reserved.