|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cs.ai.kreator.control.config.ConfigurationObject
edu.cs.ai.kreator.control.config.ConfigurationOption
public abstract class ConfigurationOption
This class represents the template for a single configuration option.
| Field Summary | |
|---|---|
static int |
REQUIRES_NO_RESTART
Static constant for a configuration option that requires no restart. |
static int |
REQUIRES_RESTART
Static constant for a configuration option that requires a restart. |
| Fields inherited from class edu.cs.ai.kreator.control.config.ConfigurationObject |
|---|
IS_EDITABLE, IS_INVISIBLE, IS_NOT_EDITABLE, IS_VISIBLE, PATHCAPTION_DELIMITER, PATHID_DELIMITER |
| Constructor Summary | |
|---|---|
ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description)
|
|
ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description,
int requiresRestart)
Creates a new configuration option with the given caption, id, and restart flag, that is both visible and editable and has no parent. |
|
ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description,
int visible,
int editable)
|
|
ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description,
int visible,
int editable,
int requiresRestart)
Creates a new configuration object with the given id, caption, the given visibility, the given editibility, the given restart flag and no parent. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getDefaultValue()
Returns the default value of this configuration option. |
boolean |
hasDefaultValue()
Checks whether this configuration option features a default value. |
abstract boolean |
isValid(java.lang.Object value)
Checks whether the given value object is valid for this option. |
abstract java.lang.Object |
parseValue(java.lang.String value)
Parses the given value (read from the XML) into a usable format appropriate for usage. |
boolean |
requiresRestart()
Checks whether this configuration option requires restart of KReator after change. |
void |
setDefaultValue(java.lang.Object defaultValue)
Sets this option's default value |
abstract java.lang.String |
writeValue(java.lang.Object value)
Translates the given value to a string appropriate to be saved in the XML. |
| Methods inherited from class edu.cs.ai.kreator.control.config.ConfigurationObject |
|---|
getCaption, getDescription, getId, getParent, getPathCaption, getPathId, hasParent, isEditable, isVisible, setParent, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int REQUIRES_RESTART
public static final int REQUIRES_NO_RESTART
| Constructor Detail |
|---|
public ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description,
int requiresRestart)
id - The id of this configuration object.description - The description of this configuration object.caption - The caption of this configuration objectrequiresRestart - one of ConfigurationOption.REQUIRES_RESTART, ConfigurationOption.REQUIRES_NO_RESTART
public ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description)
public ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description,
int visible,
int editable,
int requiresRestart)
id - The id of this configuration object.caption - The caption of this configuration object.description - The description of this configuration object.visible - whether this configuration object is visible (one of ConfigurationObject.IS_VISIBLE, ConfigurationObject.IS_INVISIBLE).editable - whether this configuration object is editable (one of ConfigurationObject.IS_EDITABLE, ConfigurationObject.IS_NOT_EDITABLE).requiresRestart - one of ConfigurationOption.REQUIRES_RESTART, ConfigurationOption.REQUIRES_NO_RESTART
public ConfigurationOption(java.lang.String id,
java.lang.String caption,
java.lang.String description,
int visible,
int editable)
| Method Detail |
|---|
public boolean requiresRestart()
public java.lang.Object getDefaultValue()
public void setDefaultValue(java.lang.Object defaultValue)
defaultValue - a default value.public boolean hasDefaultValue()
public abstract boolean isValid(java.lang.Object value)
value - a value.
public abstract java.lang.Object parseValue(java.lang.String value)
throws java.lang.IllegalArgumentException
ConfigurationOption#writeValue(java.langObject)
value - a value as string.
java.lang.IllegalArgumentException - if the string could not be parsed.
public abstract java.lang.String writeValue(java.lang.Object value)
throws java.lang.IllegalArgumentException
ConfigurationOption#isValid(java.lang.Object)
verified the validity of the value.
NOTE: This is the inverse to ConfigurationOption#parseValue(java.lang.String)
value - a value of this option.
java.lang.IllegalArgumentException - if the value does not conform to this option.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||