Package net.sf.okapi.filters.dtd
Class Parameters
- java.lang.Object
-
- net.sf.okapi.common.BaseParameters
-
- net.sf.okapi.common.StringParameters
-
- net.sf.okapi.filters.dtd.Parameters
-
- All Implemented Interfaces:
Cloneable
,IParameters
,ISimplifierRulesParameters
public class Parameters extends StringParameters implements ISimplifierRulesParameters
-
-
Field Summary
Fields Modifier and Type Field Description InlineCodeFinder
codeFinder
LocalizationDirectives
locDir
-
Fields inherited from class net.sf.okapi.common.StringParameters
buffer
-
Fields inherited from class net.sf.okapi.common.BaseParameters
path
-
Fields inherited from interface net.sf.okapi.common.ISimplifierRulesParameters
SIMPLIFIERRULES, SIMPLIFIERRULES_DISPLAY_NAME, SIMPLIFIERRULES_SHORT_DESC
-
-
Constructor Summary
Constructors Constructor Description Parameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromString(String data)
Reset this parameters object to its default values and then load additional parameters from the provided data.String
getSimplifierRules()
Get the code simplifier rules as defined bySimplifierRules
(JavaCC file: core/simplifierrules/SimplifierRules.jj).boolean
getUseCodeFinder()
void
reset()
Reset this parameters object to its default values.void
setSimplifierRules(String rules)
Set the simplifier rules.void
setUseCodeFinder(boolean useCodeFinder)
String
toString()
Serialize this parameters object to a string.void
validateSimplifierRules()
Validate the current code simplifier rules.-
Methods inherited from class net.sf.okapi.common.StringParameters
fromString, getBoolean, getGroup, getInteger, getString, setBoolean, setGroup, setInteger, setString
-
Methods inherited from class net.sf.okapi.common.BaseParameters
getParametersDescription, getPath, load, load, save, setPath
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.IParameters
copy
-
-
-
-
Field Detail
-
codeFinder
public InlineCodeFinder codeFinder
-
locDir
public LocalizationDirectives locDir
-
-
Method Detail
-
getUseCodeFinder
public boolean getUseCodeFinder()
-
setUseCodeFinder
public void setUseCodeFinder(boolean useCodeFinder)
-
reset
public void reset()
Description copied from class:StringParameters
Reset this parameters object to its default values.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.- Specified by:
reset
in interfaceIParameters
- Overrides:
reset
in classStringParameters
-
toString
public String toString()
Description copied from class:StringParameters
Serialize this parameters object to a string.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.- Specified by:
toString
in interfaceIParameters
- Overrides:
toString
in classStringParameters
- Returns:
- the string holding all the parameters.
-
fromString
public void fromString(String data)
Description copied from class:StringParameters
Reset this parameters object to its default values and then load additional parameters from the provided data.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.- Specified by:
fromString
in interfaceIParameters
- Overrides:
fromString
in classStringParameters
- Parameters:
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.
-
getSimplifierRules
public String getSimplifierRules()
Description copied from interface:ISimplifierRulesParameters
Get the code simplifier rules as defined bySimplifierRules
(JavaCC file: core/simplifierrules/SimplifierRules.jj).- Specified by:
getSimplifierRules
in interfaceISimplifierRulesParameters
- Returns:
- rules as a string.
-
setSimplifierRules
public void setSimplifierRules(String rules)
Description copied from interface:ISimplifierRulesParameters
Set the simplifier rules.- Specified by:
setSimplifierRules
in interfaceISimplifierRulesParameters
- Parameters:
rules
- new simplifier rules
-
validateSimplifierRules
public void validateSimplifierRules() throws ParseException
Description copied from interface:ISimplifierRulesParameters
Validate the current code simplifier rules.- Specified by:
validateSimplifierRules
in interfaceISimplifierRulesParameters
- Throws:
ParseException
- if the rule cannot be parsed
-
-