|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for command line parameters.
Field Summary | |
static boolean |
HIDDEN
when used as a value for the hidden indicator,
indicates that a parameter is hidden, and its description will
not be listed in the usage. |
static boolean |
MULTI_VALUED
when used as a value for the multiValued indicator,
specifies that an parameter accepts mulitiple values |
static boolean |
OPTIONAL
when used as a value for the optional indicator,
specifies that an parameter is optional |
static boolean |
PUBLIC
when used as a value for the hidden indicator,
indicates that a parameter is public, and its description will be
listed in the usage. |
static boolean |
REQUIRED
when used as a value for the optional indicator,
specifies that an parameter is required |
static boolean |
SINGLE_VALUED
when used as a value for the multiValued indicator,
specifies that a parameter accepts only one value |
Method Summary | |
void |
addValue(java.lang.String value)
adds the specified string as a value for this entity |
java.lang.String[] |
getAcceptableValues()
Gets the values that are acceptable for this parameter, if a restricted set exists. |
java.lang.String |
getDesc()
gets the value of the parameter's description |
boolean |
getIgnoreRequired()
Gets the flag indicating that during parse, missing required Parameters are ignored if this Parameter is set. |
java.lang.String |
getOptionLabel()
gets the value of optionLabel |
java.lang.String |
getTag()
gets the value of tag |
java.lang.String |
getValue()
The value of the parameter, in the case where the parameter is not multi-valued. |
java.util.Collection |
getValues()
gets the values associated with this Parameter |
boolean |
isHidden()
gets the value of the hidden indicator |
boolean |
isMultiValued()
gets the value of multiValued indicator |
boolean |
isOptional()
returns the value of the optional indicator |
boolean |
isSet()
gets an indicator that the parameter's value has been set |
void |
setAcceptableValues(java.util.Collection vals)
Sets the values that are acceptable for this parameter, if a restricted set exists. |
void |
setAcceptableValues(java.lang.String[] vals)
Sets the values that are acceptable for this parameter, if a restricted set exists. |
void |
setDesc(java.lang.String desc)
sets the value of this parameter's description |
void |
setHidden(boolean hidden)
sets the value of the hidden indicator |
void |
setIgnoreRequired(boolean ignoreRequired)
Sets a flag such that during parse, missing required Parameters are ignored if this Parameter is set. |
void |
setMultiValued(boolean multiValued)
sets the value of the multiValued indicator |
void |
setOptional(boolean optional)
indicates whether or not the parameter is optional |
void |
setOptionLabel(java.lang.String optionLabel)
Sets the value of optionLabel. |
void |
setTag(java.lang.String tag)
sets the value of tag |
void |
setValue(java.lang.String value)
Sets the value of the parameter to the specified string. |
void |
setValues(java.util.Collection values)
Sets the values of the parameter to those specified. |
void |
setValues(java.lang.String[] values)
Sets the values of the parameter to those specified. |
void |
validateValue(java.lang.String value)
verifies that value is valid for this entity |
Field Detail |
public static final boolean PUBLIC
hidden
indicator,
indicates that a parameter is public, and its description will be
listed in the usage.
public static final boolean HIDDEN
hidden
indicator,
indicates that a parameter is hidden, and its description will
not be listed in the usage.
public static final boolean OPTIONAL
optional
indicator,
specifies that an parameter is optional
public static final boolean REQUIRED
optional
indicator,
specifies that an parameter is required
public static final boolean MULTI_VALUED
multiValued
indicator,
specifies that an parameter accepts mulitiple values
public static final boolean SINGLE_VALUED
multiValued
indicator,
specifies that a parameter accepts only one value
Method Detail |
public boolean isSet()
public boolean isHidden()
HIDDEN
) if the parameter is a
hidden parameterpublic void setHidden(boolean hidden)
hidden
- true (HIDDEN
) if the parameter is a
hidden parameterpublic java.lang.String getDesc()
public void setDesc(java.lang.String desc) throws java.lang.IllegalArgumentException
desc
- a description of the parameter, suitable for display in
the command's usage
java.lang.IllegalArgumentException
- if desc
is
fewer than 5 charaters.public java.lang.String getTag()
public void setTag(java.lang.String tag) throws java.lang.IllegalArgumentException
tag
- a unique identifier for this parameter. If the
parameter is used as an option, it will be used to
identify the option on the command line. In the case
where the parameter is used as an argument, it will
only be used to identify the argument in the usage
statement. Tags must be made up of any character but
'='.
java.lang.IllegalArgumentException
- if the length of tag
is less than 1, or tag
contains an
invalid character.public boolean isMultiValued()
public void setMultiValued(boolean multiValued)
multiValued
- true if the parameter can have multiple valuespublic boolean isOptional()
public void setOptional(boolean optional)
optional
- true if the parameter is optionalpublic java.lang.String[] getAcceptableValues()
public void setAcceptableValues(java.lang.String[] vals)
vals
value, or an empty vals
array, will result in any previously set acceptable values being cleared.
vals
- the new acceptable valuesgetAcceptableValues()
public void setAcceptableValues(java.util.Collection vals)
vals
value, or an empty vals
Collection, will result in any previously set acceptable values being
cleared.
The toString()
values of the Objects in vals
will be used for the acceptable values.
vals
- the new acceptable valuespublic void addValue(java.lang.String value) throws CmdLineException
value
- the value to be added
CmdLineException
- if the value of the entity
has already been set and multiValued
is
not true
, or if
validateValue()
detects a problem.public void setValue(java.lang.String value) throws CmdLineException
value
- the new value of the parameter
if
- validateValue()
detects a problem.
CmdLineException
public void setValues(java.util.Collection values) throws CmdLineException
values
- A collection of String objects to be used as the
parameter's values.
java.lang.ClassCastException
- if the Collection contains object that
are not Strings.
CmdLineException
- if more than one value is specified
and multiValued
is not true
, or
if validateValue()
detects a problem.public void setValues(java.lang.String[] values) throws CmdLineException
values
- The String objects to be used as the
parameter's values.
CmdLineException
- if more than one value is specified
and multiValued
is not true
, or
if validateValue()
detects a problem.public void validateValue(java.lang.String value) throws CmdLineException
value
is valid for this entity
value
- the value to be validated
CmdLineException
- if value
is not valid.public java.lang.String getValue()
getValues()
public java.util.Collection getValues()
isSet()
public java.lang.String getOptionLabel()
public void setOptionLabel(java.lang.String optionLabel)
st_date <mm/dd/yy> the start date of the reportThe default is the empty string.
optionLabel
- The string used as a label for the parameter's
value. If null, an empty string is used.getOptionLabel()
public boolean getIgnoreRequired()
true
if missing required Parameters
will be ignored when this Parameter is set.public void setIgnoreRequired(boolean ignoreRequired)
ignoreRequired
- set to true
to ignore missing
required Parameters if this Parameter is setgetIgnoreRequired()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |