net.sf.mmm.util.cli.base
Class AbstractCliParser.CliOptionHelpInfo

java.lang.Object
  extended by net.sf.mmm.util.cli.base.AbstractCliParser.CliOptionHelpInfo
Enclosing class:
AbstractCliParser

protected static class AbstractCliParser.CliOptionHelpInfo
extends Object

This inner class holds the help information for a single CliOption.


Field Summary
private  int length
          The maximum length of all syntax lines of this info.
private  int lineIndex
          The current index in the buffer for syntax.
private  int lineLength
          The current maximum line index.
private  String operand
          Localized message for operand.
private  CliOptionContainer option
          The actual option.
private  String syntax
          The syntax of the option.
 
Constructor Summary
AbstractCliParser.CliOptionHelpInfo(CliOptionContainer option, CliParserDependencies dependencies, CliOutputSettings settings)
          The constructor.
 
Method Summary
private  void append(StringBuilder syntaxBuilder, String text, int maxLength, CliOutputSettings settings)
          This method appends a single option to the syntax.
 int getLength()
           
 String getOperand()
           
 String getSyntax()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

option

private final CliOptionContainer option
The actual option.


syntax

private final String syntax
The syntax of the option.


operand

private final String operand
Localized message for operand.


length

private final int length
The maximum length of all syntax lines of this info.


lineIndex

private int lineIndex
The current index in the buffer for syntax.


lineLength

private int lineLength
The current maximum line index.

Constructor Detail

AbstractCliParser.CliOptionHelpInfo

public AbstractCliParser.CliOptionHelpInfo(CliOptionContainer option,
                                           CliParserDependencies dependencies,
                                           CliOutputSettings settings)
The constructor.

Parameters:
option - is the CliOptionContainer.
dependencies - are the CliParserDependencies.
settings - are the CliOutputSettings.
Method Detail

append

private void append(StringBuilder syntaxBuilder,
                    String text,
                    int maxLength,
                    CliOutputSettings settings)
This method appends a single option to the syntax. It automatically wraps and updates lineLength and lineIndex.

Parameters:
syntaxBuilder - is the buffer used to build the syntax.
text - is the text to append.
maxLength - is the maximum length allowed for a single line.
settings - are the CliOutputSettings.

getLength

public int getLength()
Returns:
the length

getSyntax

public String getSyntax()
Returns:
the syntax

getOperand

public String getOperand()
Returns:
the operand


Copyright © 2001-2010 mmm-Team. All Rights Reserved.