|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.cli.base.AbstractCliParser.CliHelpWriter
public static class AbstractCliParser.CliHelpWriter
This inner class is a helper to simplify writing the help-usage.
| Field Summary | |
|---|---|
private Appendable |
appendable
The Appendable where to write help to. |
private Map<String,Object> |
arguments
The NLS-arguments. |
private CliParserDependencies |
dependencies
The CliParserDependencies. |
private TextColumnInfo |
mainColumnInfo
The TextColumnInfo for the main column. |
private TextColumnInfo |
parameterColumnInfo
The TextColumnInfo for parameters (e.g. |
private Object |
state
The state-object. |
private TextTableInfo |
tableInfo
The TextTableInfo. |
| Constructor Summary | |
|---|---|
AbstractCliParser.CliHelpWriter(Appendable appendable,
CliOutputSettings settings,
CliParserDependencies dependencies,
CliState cliState,
Object state)
The constructor. |
|
| Method Summary | |
|---|---|
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 |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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.
private final CliParserDependencies dependencies
CliParserDependencies.
private final Map<String,Object> arguments
private final Object state
state-object.
| Constructor Detail |
|---|
public AbstractCliParser.CliHelpWriter(Appendable appendable,
CliOutputSettings settings,
CliParserDependencies dependencies,
CliState cliState,
Object state)
appendable - is the Appendable where to write help to.settings - is the CliOutputSettings.dependencies - are the CliParserDependencies.cliState - is the CliState.state - is the state-object.| Method Detail |
|---|
public Map<String,Object> getArguments()
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.
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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||