Package com.ibm.icu.dev.tool.shared
Class UOption
java.lang.Object
com.ibm.icu.dev.tool.shared.UOption
A command-line option. A UOption specifies the name of an option
and whether or not it takes an argument. It is a mutable object
that later contains the option argument, if any, and a boolean
flag stating whether the option was seen or not.
The static method parseArgs() takes an array of command-line
arguments and an array of UOptions and parses the command-line
arguments.
This deliberately resembles the icu4c file uoption.[ch].
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanintstatic final intstatic final intstatic final intchar -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UOptionstatic UOptionstatic UOptionCreate a UOption with the given attributes.static UOptionCreate a UOption with the given attributes.static UOptionDESTDIR()static UOptionENCODING()static UOptionHELP_H()static UOptionstatic UOptionstatic UOptionstatic intJava Command line argument parser.static intConvenient method.static UOptionQUIET()setDefault(String s) Allows the default to be set in an option list.static UOptionprivate static voidsyntaxError(String message) Throw an exception indicating a syntax error.static UOptionVERBOSE()static UOptionVERSION()
-
Field Details
-
longName
-
value
-
optionFn
-
context
-
shortName
public char shortName -
hasArg
public int hasArg -
doesOccur
public boolean doesOccur -
NO_ARG
public static final int NO_ARG- See Also:
-
REQUIRES_ARG
public static final int REQUIRES_ARG- See Also:
-
OPTIONAL_ARG
public static final int OPTIONAL_ARG- See Also:
-
-
Constructor Details
-
UOption
Constructor.
-
-
Method Details
-
create
Create a UOption with the given attributes. -
DEF
Create a UOption with the given attributes. Synonym for create(), for C compatibility. -
HELP_H
-
HELP_QUESTION_MARK
-
VERBOSE
-
QUIET
-
VERSION
-
COPYRIGHT
-
DESTDIR
-
SOURCEDIR
-
ENCODING
-
ICUDATADIR
-
PACKAGE_NAME
-
BUNDLE_NAME
-
setDefault
Allows the default to be set in an option list.- Parameters:
s-- Returns:
- this
-
syntaxError
Throw an exception indicating a syntax error.
-