protected class Options.DateOptionDef extends Options.OptionDef
mDefaultValues, mNumValuesNeeded
Constructor and Description |
---|
DateOptionDef(String name,
Date defValue,
String desc)
Construct a date option.
|
DateOptionDef(String name,
String desc)
Construct a date option.
|
Modifier and Type | Method and Description |
---|---|
void |
validateOption(ArrayList values)
Ensure that this option has a single value that is a valid
date.
|
getBigDecimal, getBoolean, getDate, getDefaultValues, getDesc, getInteger, getIthDefaultAsString, getName, getNumValuesNeeded, getString, getStrings, isRequiredOption, toString
public DateOptionDef(String name, Date defValue, String desc)
name
- The name of the option. The name should include
the leading "-" (i.e. -start).defValue
- The default value to use if the option does not
appear on the command line. A value of null implies the current
date.desc
- The description of the option.public DateOptionDef(String name, String desc)
parse
method will
throw an exception if the option does not appear on the command
line.
name
- The name of the option. The name should include
the leading "-" (i.e. -start).desc
- The description of the option.public void validateOption(ArrayList values) throws CommandLineParser.OptionDataException
validateOption
in class Options.OptionDef
values
- An array that contains the values that were specified
on the command line for the option. If no values were specified
then the array will be empty.OptionDataException
- There was not only one value that
is a valid date.CommandLineParser.OptionDataException
Copyright © 2003, 2023, Oracle and/or its affiliates.