public abstract class AbstractClassOption extends AbstractOption
Modifier and Type | Field and Description |
---|---|
protected Object |
currentValue
The current object
|
protected String |
defaultCLIString
The default command line interface text.
|
static String |
FILE_PREFIX_STRING
The prefix text to use to indicate file.
|
static String |
INMEM_PREFIX_STRING
The prefix text to use to indicate inmem.
|
protected String |
nullString
The null text.
|
protected Class<?> |
requiredType
The class type
|
cliChar, illegalNameCharacters, name, purpose
Constructor and Description |
---|
AbstractClassOption(String name,
char cliChar,
String purpose,
Class<?> requiredType,
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(String name,
char cliChar,
String purpose,
Class<?> requiredType,
String defaultCLIString,
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 and Description |
---|---|
static String |
classToCLIString(Class<?> aClass,
Class<?> requiredType)
Gets the command line interface text of the class.
|
String |
getDefaultCLIString()
Gets the Command Line Interface text
|
abstract JComponent |
getEditComponent()
Gets the GUI component to edit
|
String |
getNullString()
Gets the null string of this option.
|
Object |
getPreMaterializedObject()
Returns the current object.
|
Class<?> |
getRequiredType()
Gets the class type of this option.
|
abstract String |
getValueAsCLIString()
Gets the value of a Command Line Interface text as a string
|
Object |
materializeObject(TaskMonitor monitor,
ObjectRepository repository)
Gets a materialized object of this option.
|
void |
setCurrentObject(Object obj)
Sets current object.
|
abstract void |
setValueViaCLIString(String s)
Sets value of this option via the Command Line Interface text
|
static String |
stripPackagePrefix(String className,
Class<?> expectedType)
Gets the class name without its package name prefix.
|
copy, getCLIChar, getDescription, getName, getPurpose, getStateString, nameIsLegal, resetToDefault
copy, measureByteSize, measureByteSize, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
measureByteSize
public static final String FILE_PREFIX_STRING
public static final String INMEM_PREFIX_STRING
protected Object currentValue
protected Class<?> requiredType
protected String defaultCLIString
protected String nullString
public AbstractClassOption(String name, char cliChar, String purpose, Class<?> requiredType, 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(String name, char cliChar, String purpose, Class<?> requiredType, String defaultCLIString, 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(Object obj)
obj
- the object to set as current.public Object getPreMaterializedObject()
public Class<?> getRequiredType()
public String getNullString()
public Object materializeObject(TaskMonitor monitor, ObjectRepository repository)
monitor
- the task monitor to userepository
- the object repository to usepublic String getDefaultCLIString()
Option
public static String classToCLIString(Class<?> aClass, Class<?> requiredType)
aClass
- the classrequiredType
- the class typepublic abstract String getValueAsCLIString()
Option
public abstract void setValueViaCLIString(String s)
Option
s
- the Command Line Interface textpublic abstract JComponent getEditComponent()
Option
getEditComponent
in interface Option
getEditComponent
in class AbstractOption
Copyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.