public abstract class AbstractParameters extends StringParameters implements INotifiable, ISimplifierRulesParameters
| Modifier and Type | Field and Description |
|---|---|
protected Component |
owner |
bufferpathSIMPLIFIERRULES, SIMPLIFIERRULES_DISPLAY_NAME, SIMPLIFIERRULES_SHORT_DESC| Constructor and Description |
|---|
AbstractParameters() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exec(Object sender,
String command,
Object info)
Sends a command for the object to react
|
void |
fromString(String data)
Reset this parameters object to its default values and then load
additional parameters from the provided data.
|
String |
getData() |
String |
getSimplifierRules()
Get the code simplifier rules as defined by
SimplifierRules
(JavaCC file: core/simplifierrules/SimplifierRules.jj). |
boolean |
loadFromResource(Class<?> classRef,
String resourceLocation) |
boolean |
loadFromResource(String resourceLocation) |
<T extends AbstractParameters> |
loadGroup(ParametersString buffer,
List<T> group,
Class<T> elementClass) |
<T extends AbstractParameters> |
loadGroup(ParametersString buffer,
String groupName,
List<T> group,
Class<T> elementClass) |
protected void |
parameters_init()
Called from the parameters' constructor.
|
protected abstract void |
parameters_load(ParametersString buffer)
Load from buffer.
|
protected abstract void |
parameters_reset()
Reset parameters values to defaults.
|
protected abstract void |
parameters_save(ParametersString buffer)
Save to buffer.
|
void |
reset()
Reset this parameters object to its default values.
|
<T extends AbstractParameters> |
saveGroup(ParametersString buffer,
List<T> group,
Class<T> elementClass) |
<T extends AbstractParameters> |
saveGroup(ParametersString buffer,
String groupName,
List<T> group) |
void |
saveToResource(Class<?> classRef,
String resourceLocation) |
void |
saveToResource(String resourceLocation) |
void |
setSimplifierRules(String rules)
Set the simplifier rules.
|
String |
toString()
Serialize this parameters object to a string.
|
void |
validateSimplifierRules()
Validate the current code simplifier rules.
|
fromString, getBoolean, getGroup, getInteger, getString, setBoolean, setGroup, setInteger, setStringgetParametersDescription, getPath, load, load, save, setPathprotected Component owner
protected void parameters_init()
protected abstract void parameters_reset()
protected abstract void parameters_load(ParametersString buffer)
protected abstract void parameters_save(ParametersString buffer)
public final void reset()
StringParameters
Subclasses should override this method to set any initial
values and instantiate any objects that require allocation. It
is recommended that subclasses also call super.reset()
in the override to ensure that the buffer is empty.
reset in interface IParametersreset in class StringParameterspublic final void fromString(String data)
StringParameters
Subclasses should not normally need to override this method unless
they are maintaining complex values (eg, InlineCodeFinder)
that require extra initialization as part of their parameter state.
fromString in interface IParametersfromString in class StringParametersdata - the string holding the parameters. It must be formatted as
the string generated by toString(). Line-breaks must be normalized to '\n'.
It can also be null or empty, in such case the parameters are left with
their current values. Use reset() to reset the parameters to their defaults.public final String toString()
StringParameters
Subclasses should not normally need to override this method unless
they are maintaining complex values (eg, InlineCodeFinder)
that require extra serialization as part of their parameter state.
toString in interface IParameterstoString in class StringParameterspublic boolean exec(Object sender, String command, Object info)
INotifiableexec in interface INotifiablecommand - a string identifying the commandinfo - command-specific objectpublic <T extends AbstractParameters> void loadGroup(ParametersString buffer, List<T> group, Class<T> elementClass)
public <T extends AbstractParameters> void loadGroup(ParametersString buffer, String groupName, List<T> group, Class<T> elementClass)
public <T extends AbstractParameters> void saveGroup(ParametersString buffer, String groupName, List<T> group)
public <T extends AbstractParameters> void saveGroup(ParametersString buffer, List<T> group, Class<T> elementClass)
public boolean loadFromResource(String resourceLocation)
public void saveToResource(String resourceLocation)
public String getData()
public String getSimplifierRules()
ISimplifierRulesParametersSimplifierRules
(JavaCC file: core/simplifierrules/SimplifierRules.jj).getSimplifierRules in interface ISimplifierRulesParameterspublic void setSimplifierRules(String rules)
ISimplifierRulesParameterssetSimplifierRules in interface ISimplifierRulesParametersrules - new simplifier rulespublic void validateSimplifierRules()
throws ParseException
ISimplifierRulesParametersvalidateSimplifierRules in interface ISimplifierRulesParametersParseException - if the rule cannot be parsedCopyright © 2021. All rights reserved.