com.openexchange.admin.console
Class CLIOption

java.lang.Object
  extended by com.openexchange.admin.console.CLIOption
Direct Known Subclasses:
CLIOption.CLIBooleanOption, CLIOption.CLIDoubleOption, CLIOption.CLIIntegerOption, CLIOption.CLILongOption, CLIOption.CLISettableBooleanOption, CLIOption.CLIStringOption

public abstract class CLIOption
extends Object

CLIOption - A command-line option.

Author:
Thorben Betten

Nested Class Summary
static class CLIOption.CLIBooleanOption
          A boolean option.
static class CLIOption.CLIDoubleOption
          A double option.
static class CLIOption.CLIIntegerOption
          An integer option.
static class CLIOption.CLILongOption
          A long option.
static class CLIOption.CLISettableBooleanOption
          A settable boolean option.
static class CLIOption.CLIStringOption
          A string option.
 
Method Summary
 String longForm()
          Gets option's long form.
 Object parseValue(String value, Locale locale)
          Parses the specified option's value.
 String shortForm()
          Gets option's short form.
 boolean wantsValue()
          Tells whether or not this option wants a value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

shortForm

public String shortForm()
Gets option's short form.

Returns:
The short form

longForm

public String longForm()
Gets option's long form.

Returns:
The long form

wantsValue

public boolean wantsValue()
Tells whether or not this option wants a value


parseValue

public Object parseValue(String value,
                         Locale locale)
                  throws CLIIllegalOptionValueException
Parses the specified option's value.

Parameters:
value - The option's value
locale - The locale
Returns:
The option's value
Throws:
CLIIllegalOptionValueException - If an illegal or missing value is experienced