Option
, java.io.Serializable
ClassOption
public abstract class AbstractClassOption extends AbstractOption
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.Object |
currentValue |
The current object
|
protected java.lang.String |
defaultCLIString |
The default command line interface text.
|
static java.lang.String |
FILE_PREFIX_STRING |
The prefix text to use to indicate file.
|
static java.lang.String |
INMEM_PREFIX_STRING |
The prefix text to use to indicate inmem.
|
protected java.lang.String |
nullString |
The null text.
|
protected java.lang.Class<?> |
requiredType |
The class type
|
cliChar, illegalNameCharacters, name, purpose
Constructor | Description |
---|---|
AbstractClassOption(java.lang.String name,
char cliChar,
java.lang.String purpose,
java.lang.Class<?> requiredType,
java.lang.String defaultCLIString) |
Creates a new instance of an abstract option given its class name,
command line interface text, its purpose, its class type and its default
command line interface text.
|
AbstractClassOption(java.lang.String name,
char cliChar,
java.lang.String purpose,
java.lang.Class<?> requiredType,
java.lang.String defaultCLIString,
java.lang.String nullString) |
Creates a new instance of an abstract option given its class name,
command line interface text, its purpose, its class type, default
command line interface text, and its null text.
|
Modifier and Type | Method | Description |
---|---|---|
static java.lang.String |
classToCLIString(java.lang.Class<?> aClass,
java.lang.Class<?> requiredType) |
Gets the command line interface text of the class.
|
java.lang.String |
getDefaultCLIString() |
Gets the Command Line Interface text
|
java.lang.String |
getNullString() |
Gets the null string of this option.
|
java.lang.Class<?> |
getRequiredType() |
Gets the class type of this option.
|
java.lang.Object |
getValue() |
Returns the current object.
|
abstract java.lang.String |
getValueAsCLIString() |
Gets the value of a Command Line Interface text as a string
|
java.lang.Object |
materializeObject() |
Gets a materialized object of this option.
|
void |
setCurrentObject(java.lang.Object obj) |
Sets current object.
|
abstract void |
setValueViaCLIString(java.lang.String s) |
Sets value of this option via the Command Line Interface text
|
static java.lang.String |
stripPackagePrefix(java.lang.String className,
java.lang.Class<?> expectedType) |
Gets the class name without its package name prefix.
|
copy, getCLIChar, getName, getPurpose, getStateString, nameIsLegal, resetToDefault
public static final java.lang.String FILE_PREFIX_STRING
public static final java.lang.String INMEM_PREFIX_STRING
protected java.lang.Object currentValue
protected java.lang.Class<?> requiredType
protected java.lang.String defaultCLIString
protected java.lang.String nullString
public AbstractClassOption(java.lang.String name, char cliChar, java.lang.String purpose, java.lang.Class<?> requiredType, java.lang.String defaultCLIString)
name
- the name of this optioncliChar
- the command line interface textpurpose
- the text describing the purpose of this optionrequiredType
- the class typedefaultCLIString
- the default command line interface textpublic AbstractClassOption(java.lang.String name, char cliChar, java.lang.String purpose, java.lang.Class<?> requiredType, java.lang.String defaultCLIString, java.lang.String nullString)
name
- the name of this optioncliChar
- the command line interface textpurpose
- the text describing the purpose of this optionrequiredType
- the class typedefaultCLIString
- the default command line interface textnullString
- the null textpublic void setCurrentObject(java.lang.Object obj)
obj
- the object to set as current.public java.lang.Object getValue()
public java.lang.Class<?> getRequiredType()
public java.lang.String getNullString()
public java.lang.Object materializeObject()
public java.lang.String getDefaultCLIString()
Option
public static java.lang.String classToCLIString(java.lang.Class<?> aClass, java.lang.Class<?> requiredType)
aClass
- the classrequiredType
- the class typepublic abstract java.lang.String getValueAsCLIString()
Option
public abstract void setValueViaCLIString(java.lang.String s)
Option
s
- the Command Line Interface textpublic static java.lang.String stripPackagePrefix(java.lang.String className, java.lang.Class<?> expectedType)
className
- the name of the classexpectedType
- the type of the classCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.