public class YamlParameters extends BaseParameters implements ISimplifierRulesParameters
IParameters
based facade around the YAML configuration format.
The parameters are read-only; calls to setXXX() are ignored.path
SIMPLIFIERRULES, SIMPLIFIERRULES_DISPLAY_NAME, SIMPLIFIERRULES_SHORT_DESC
Constructor and Description |
---|
YamlParameters() |
YamlParameters(java.io.File configFile) |
YamlParameters(java.lang.String configAsString) |
YamlParameters(java.net.URL configPath) |
Modifier and Type | Method and Description |
---|---|
void |
fromString(java.lang.String data)
Parses the parameters stored into a string back into the object.
|
boolean |
getBoolean(java.lang.String name)
Gets the boolean value for the given parameter name.
|
static java.lang.String |
getDefualtParameterFile() |
int |
getInteger(java.lang.String name)
Gets the integer value for a given parameter name.
|
java.lang.String |
getSimplifierRules()
Get the code simplifier rules as defined by
SimplifierRules
(JavaCC file: core/simplifierrules/SimplifierRules.jj). |
java.lang.String |
getString(java.lang.String name)
Gets the string value for a given parameter name.
|
TaggedFilterConfiguration |
getTaggedConfig() |
void |
reset()
Reset the parameters to their default values.
|
void |
setBoolean(java.lang.String name,
boolean value)
Sets the boolean value for a given parameter name.
|
void |
setInteger(java.lang.String name,
int value)
Sets the integer value for a given parameter name.
|
void |
setSimplifierRules(java.lang.String rules)
Set the simplifier rules.
|
void |
setString(java.lang.String name,
java.lang.String value)
Sets the string value for a given parameter name.
|
void |
setTaggedConfig(TaggedFilterConfiguration taggedConfig) |
java.lang.String |
toString()
Converts the parameters into a string.
|
void |
validateSimplifierRules()
Validate the current code simplifier rules.
|
getParametersDescription, getPath, load, load, save, setPath
public YamlParameters()
public YamlParameters(java.net.URL configPath)
public YamlParameters(java.io.File configFile)
public YamlParameters(java.lang.String configAsString)
public static java.lang.String getDefualtParameterFile()
public void fromString(java.lang.String data)
IParameters
fromString
in interface IParameters
data
- 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 java.lang.String toString()
IParameters
toString
in interface IParameters
toString
in class java.lang.Object
public void reset()
IParameters
reset
in interface IParameters
public TaggedFilterConfiguration getTaggedConfig()
public void setTaggedConfig(TaggedFilterConfiguration taggedConfig)
taggedConfig
- new configurationpublic boolean getBoolean(java.lang.String name)
IParameters
getBoolean
in interface IParameters
name
- the name of the boolean parameter to retrieve.public void setBoolean(java.lang.String name, boolean value)
IParameters
setBoolean
in interface IParameters
name
- the name of the parameter to set.value
- the new value to set.public java.lang.String getString(java.lang.String name)
IParameters
getString
in interface IParameters
name
- the name of the string parameter to retrieve.public void setString(java.lang.String name, java.lang.String value)
IParameters
setString
in interface IParameters
name
- the name of the parameter to set.value
- the new value to set.public int getInteger(java.lang.String name)
IParameters
getInteger
in interface IParameters
name
- the name of the integer parameter to retrieve.public void setInteger(java.lang.String name, int value)
IParameters
setInteger
in interface IParameters
name
- the name of the parameter to set.value
- the new value to set.public java.lang.String getSimplifierRules()
ISimplifierRulesParameters
SimplifierRules
(JavaCC file: core/simplifierrules/SimplifierRules.jj).getSimplifierRules
in interface ISimplifierRulesParameters
public void setSimplifierRules(java.lang.String rules)
ISimplifierRulesParameters
setSimplifierRules
in interface ISimplifierRulesParameters
rules
- new simplifier rulespublic void validateSimplifierRules() throws ParseException
ISimplifierRulesParameters
validateSimplifierRules
in interface ISimplifierRulesParameters
ParseException
- if the rule cannot be parsedCopyright © 2022. All rights reserved.