org.fuin.kickstart4j
Class CmdLineOption

java.lang.Object
  extended by org.fuin.kickstart4j.CmdLineOption

public final class CmdLineOption
extends java.lang.Object

Represents a single command line option.


Constructor Summary
CmdLineOption(java.lang.String key, java.lang.String valueName, java.lang.String usage)
          Constructor for a optional option.
CmdLineOption(java.lang.String key, java.lang.String valueName, java.lang.String usage, boolean required)
          Constructor with required argument.
 
Method Summary
 java.lang.String getKey()
          Returns the key of the option.
 java.lang.String getOptionText(MessagesWrapper msg)
          Returns the option text.
 java.lang.String getUsage()
          Returns the text displayed in the usage message.
 java.lang.String getValueName()
          Returns the name of the value displayed in the usage message.
 boolean isRequired()
          Returns if the the value is required or optional.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdLineOption

public CmdLineOption(java.lang.String key,
                     java.lang.String valueName,
                     java.lang.String usage)
Constructor for a optional option.

Parameters:
key - Key (short name) of the option.
valueName - Name of the value displayed in the usage message.
usage - Text displayed in the usage message.

CmdLineOption

public CmdLineOption(java.lang.String key,
                     java.lang.String valueName,
                     java.lang.String usage,
                     boolean required)
Constructor with required argument.

Parameters:
key - Key (short name) of the option.
valueName - Name of the value displayed in the usage message.
usage - Text displayed in the usage message.
required - Determines if the value is required or optional.
Method Detail

getKey

public final java.lang.String getKey()
Returns the key of the option.

Returns:
Short name.

getUsage

public final java.lang.String getUsage()
Returns the text displayed in the usage message.

Returns:
Message explaining the option.

isRequired

public final boolean isRequired()
Returns if the the value is required or optional.

Returns:
If required true else false.

getValueName

public final java.lang.String getValueName()
Returns the name of the value displayed in the usage message.

Returns:
Name of the value.

getOptionText

public final java.lang.String getOptionText(MessagesWrapper msg)
Returns the option text.

Parameters:
msg - Localized message texts.
Returns:
Option text.


Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.