jargs.gnu

Class CmdLineParser.Option

public abstract static class CmdLineParser.Option extends Object

Representation of a command-line option
Nested Class Summary
static classCmdLineParser.Option.BooleanOption
static classCmdLineParser.Option.DoubleOption
An option that expects a floating-point value
static classCmdLineParser.Option.IntegerOption
An option that expects an integer value
static classCmdLineParser.Option.LongOption
An option that expects a long integer value
static classCmdLineParser.Option.StringOption
An option that expects a string value
Constructor Summary
protected Option(String longForm, boolean wantsValue)
protected Option(char shortForm, String longForm, boolean wantsValue)
Method Summary
ObjectgetValue(String arg, Locale locale)
StringlongForm()
protected ObjectparseValue(String arg, Locale locale)
Override to extract and convert an option value passed on the command-line
StringshortForm()
booleanwantsValue()
Tells whether or not this option wants a value

Constructor Detail

Option

protected Option(String longForm, boolean wantsValue)

Option

protected Option(char shortForm, String longForm, boolean wantsValue)

Method Detail

getValue

public final Object getValue(String arg, Locale locale)

longForm

public String longForm()

parseValue

protected Object parseValue(String arg, Locale locale)
Override to extract and convert an option value passed on the command-line

shortForm

public String shortForm()

wantsValue

public boolean wantsValue()
Tells whether or not this option wants a value
Copyright © 2001-2003 Steve Purcell. Copyright © 2002 Vidar Holen. Copyright © 2002 Michal Ceresna. Copyright © 2005 Ewan Mellor. Released under the terms of the BSD licence.