public abstract class AbstractReflectedChoice extends Object implements Choice
The GNU Lesser General Public License for details.| Modifier and Type | Field and Description |
|---|---|
private Class<? extends Object> |
clazz
The type that we reflect to
|
private boolean |
external
Whether this choice is managed externally, via setXXX and getXXX.
|
private String |
fullPath
The full path of this item
|
private Method |
getter
The method to call to get the value
|
private String |
helptext
The help text (tooltip) for this item
|
private boolean |
hidden
Whether this choice should be visible or hidden
|
private boolean |
ignored
Whether this choice should be ignored altogether.
|
private String |
key
The key of the option.
|
private static org.slf4j.Logger |
log
The log stream
|
private String |
propertyname
The property that we call on the reflecting class
|
private boolean |
restart
Whether this choice is requires a restart to be seen.
|
private Method |
setter
The method to call to set the value
|
private String |
type
The type (as specified in config.xml)
|
| Constructor and Description |
|---|
AbstractReflectedChoice() |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
convertToObject(String orig)
Convert from a stored string to an object to use with reflection
|
abstract String |
convertToString(Object orig)
Convert from a reflection return value to a String for storage
|
String |
getFullPath()
The full path of the option.
|
String |
getHelpText()
Gets a brief description of what is going on
|
String |
getKey()
The key of the option.
|
String |
getString()
String value to associate with the name (key)
|
String |
getType()
The type by which UIs can pick an appropriate editor
|
void |
init(org.jdom2.Element option,
ResourceBundle configResources)
String value to associate with the name (key)
|
boolean |
isHidden()
Whether this should be visible in a Config Editor.
|
boolean |
isIgnored()
Whether this should be ignored altogether in a Config Editor.
|
boolean |
isSaveable()
Is this Choice OK to write out to a file, or should we use settings in
this run of the program, but forget them for next time.
|
boolean |
requiresRestart()
Do we need to restart the program in order for this change to have
effect?
|
void |
setFullPath(String newFullPath)
Sets the full path of the option.
|
void |
setHelpText(String helptext)
Sets a brief description of what is going on
|
void |
setString(String value)
String value to associate with this Field.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConversionClassprivate String key
private String propertyname
private String type
private Method getter
private Method setter
private String helptext
private String fullPath
private boolean hidden
private boolean ignored
private boolean external
private boolean restart
private static final org.slf4j.Logger log
public void init(org.jdom2.Element option,
ResourceBundle configResources)
throws StartupException
Choiceinit in interface Choiceoption - the optionconfigResources - the resource bundle to loadStartupException - if startup is not possiblepublic String getType()
Choicepublic abstract String convertToString(Object orig)
orig - the object to be converted to a stringpublic abstract Object convertToObject(String orig)
orig - the marshaled representation of the objectpublic String getFullPath()
ChoicegetFullPath in interface Choicepublic void setFullPath(String newFullPath)
ChoicesetFullPath in interface ChoicenewFullPath - The path string as supplied in config.propertiespublic String getHelpText()
ChoicegetHelpText in interface Choicepublic void setHelpText(String helptext)
ChoicesetHelpText in interface Choicehelptext - Some help textpublic boolean isSaveable()
ChoiceisSaveable in interface Choicepublic boolean isHidden()
Choicepublic boolean isIgnored()
Choicepublic boolean requiresRestart()
ChoicerequiresRestart in interface Choicepublic String getString()
Choicepublic void setString(String value) throws ConfigException
ChoicesetString in interface Choicevalue - The new value for this ChoiceConfigException - if there is a problem with the configuration