Package com.portal.common
Class Options.DateOptionDef
java.lang.Object
com.portal.common.Options.OptionDef
com.portal.common.Options.DateOptionDef
- Enclosing class:
Options
Definition of a date option. This is an option that will be
followed by a single date (i.e. 1/12/2001) value on the command line.
-
Field Summary
Fields inherited from class com.portal.common.Options.OptionDef
mDefaultValues, mNumValuesNeeded
-
Constructor Summary
ConstructorsConstructorDescriptionDateOptionDef
(String name, String desc) Construct a date option.DateOptionDef
(String name, Date defValue, String desc) Construct a date option. -
Method Summary
Modifier and TypeMethodDescriptionvoid
validateOption
(ArrayList values) Ensure that this option has a single value that is a valid date.Methods inherited from class com.portal.common.Options.OptionDef
getBigDecimal, getBoolean, getDate, getDefaultValues, getDesc, getInteger, getIthDefaultAsString, getName, getNumValuesNeeded, getString, getStrings, isRequiredOption, toString
-
Constructor Details
-
DateOptionDef
Construct a date option. This is an option that will be followed by a single date value on the command line. If the option does not appear on the command line then use the specified default value.- Parameters:
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.
-
DateOptionDef
Construct a date option. This is an option that will be followed by a single date value on the command line. This is a required option and theparse
method will throw an exception if the option does not appear on the command line.- Parameters:
name
- The name of the option. The name should include the leading "-" (i.e. -start).desc
- The description of the option.
-
-
Method Details
-
validateOption
Ensure that this option has a single value that is a valid date.- Overrides:
validateOption
in classOptions.OptionDef
- Parameters:
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.- Throws:
CommandLineParser.OptionDataException
- There was not only one value that is a valid date.
-