Package net.sf.okapi.filters.its
Class Parameters
- java.lang.Object
-
- net.sf.okapi.filters.its.Parameters
-
- All Implemented Interfaces:
IParameters
public class Parameters extends Object implements IParameters
-
-
Field Summary
Fields Modifier and Type Field Description InlineCodeFindercodeFinderbooleanescapeGTbooleanescapeLineBreakbooleanescapeNbspbooleanescapeQuotesbooleanextractIfOnlyCodesbooleaninlineCdatabooleanlineBreakAsCodebooleanmapAnnotationsbooleanomitXMLDeclarationbooleanprotectEntityRefintquoteModebooleanquoteModeDefinedStringsimplifierRulesbooleanuseCodeFinder
-
Constructor Summary
Constructors Constructor Description Parameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfromString(String data)Parses the parameters stored into a string back into the object.booleangetBoolean(String name)Gets the boolean value for the given parameter name.DocumentgetDocument()intgetInteger(String name)Gets the integer value for a given parameter name.ParametersDescriptiongetParametersDescription()Gets the description of the parameters.StringgetPath()Gets the full path of the last file where the parameters where loaded from or saved to.StringgetSimplifierRules()StringgetString(String name)Gets the string value for a given parameter name.URIgetURI()voidload(InputStream inStream, boolean ignoreErrors)Loads the parameters from a file.voidload(URL inputURL, boolean ignoreErrors)Loads the parameters from a file.voidreset()Reset the parameters to their default values.voidsave(String filePath)Saves the parameters to a file.voidsetBoolean(String name, boolean value)Sets the boolean value for a given parameter name.voidsetInteger(String name, int value)Sets the integer value for a given parameter name.voidsetPath(String filePath)Sets the full path of the file where the parameters are to be saved to.voidsetSimplifierRules(String simplifierRules)voidsetString(String name, String value)Sets the string value for a given parameter name.StringtoString()Converts the parameters into a string.
-
-
-
Field Detail
-
useCodeFinder
public boolean useCodeFinder
-
codeFinder
public InlineCodeFinder codeFinder
-
escapeGT
public boolean escapeGT
-
escapeNbsp
public boolean escapeNbsp
-
protectEntityRef
public boolean protectEntityRef
-
escapeLineBreak
public boolean escapeLineBreak
-
lineBreakAsCode
public boolean lineBreakAsCode
-
omitXMLDeclaration
public boolean omitXMLDeclaration
-
escapeQuotes
public boolean escapeQuotes
-
extractIfOnlyCodes
public boolean extractIfOnlyCodes
-
mapAnnotations
public boolean mapAnnotations
-
inlineCdata
public boolean inlineCdata
-
quoteModeDefined
public boolean quoteModeDefined
-
quoteMode
public int quoteMode
-
simplifierRules
public String simplifierRules
-
-
Method Detail
-
toString
public String toString()
Description copied from interface:IParametersConverts the parameters into a string.- Specified by:
toStringin interfaceIParameters- Overrides:
toStringin classObject- Returns:
- the string holding all the parameters.
-
fromString
public void fromString(String data)
Description copied from interface:IParametersParses the parameters stored into a string back into the object.- Specified by:
fromStringin interfaceIParameters- 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.
-
getPath
public String getPath()
Description copied from interface:IParametersGets the full path of the last file where the parameters where loaded from or saved to.- Specified by:
getPathin interfaceIParameters- Returns:
- the full path of the last load() or save(), or null if object was not loaded nor saved.
-
setPath
public void setPath(String filePath)
Description copied from interface:IParametersSets the full path of the file where the parameters are to be saved to.- Specified by:
setPathin interfaceIParameters- Parameters:
filePath- the full path to set.
-
load
public void load(URL inputURL, boolean ignoreErrors)
Description copied from interface:IParametersLoads the parameters from a file.- Specified by:
loadin interfaceIParameters- Parameters:
inputURL- URL of the parameters file to load.ignoreErrors- true if the load should ignore any error such as file not found. If an error occurs and this is set to true, the method should create the parameters object with its default values.
-
load
public void load(InputStream inStream, boolean ignoreErrors)
Description copied from interface:IParametersLoads the parameters from a file.- Specified by:
loadin interfaceIParameters- Parameters:
inStream- input stream with the parameters to load.ignoreErrors- true if the load should ignore any error such as file not found. If an error occurs and this is set to true, the method should create the parameters object with its default values.
-
reset
public void reset()
Description copied from interface:IParametersReset the parameters to their default values.- Specified by:
resetin interfaceIParameters
-
save
public void save(String filePath)
Description copied from interface:IParametersSaves the parameters to a file.- Specified by:
savein interfaceIParameters- Parameters:
filePath- the full path of the parameters file to save.
-
getDocument
public Document getDocument()
-
getURI
public URI getURI()
-
getBoolean
public boolean getBoolean(String name)
Description copied from interface:IParametersGets the boolean value for the given parameter name.- Specified by:
getBooleanin interfaceIParameters- Parameters:
name- the name of the boolean parameter to retrieve.- Returns:
- the value of the given parameter, or false if it is not defined.
-
setBoolean
public void setBoolean(String name, boolean value)
Description copied from interface:IParametersSets the boolean value for a given parameter name.- Specified by:
setBooleanin interfaceIParameters- Parameters:
name- the name of the parameter to set.value- the new value to set.
-
getString
public String getString(String name)
Description copied from interface:IParametersGets the string value for a given parameter name.- Specified by:
getStringin interfaceIParameters- Parameters:
name- the name of the string parameter to retrieve.- Returns:
- the value of the given parameter, or null if it is not defined.
-
setString
public void setString(String name, String value)
Description copied from interface:IParametersSets the string value for a given parameter name.- Specified by:
setStringin interfaceIParameters- Parameters:
name- the name of the parameter to set.value- the new value to set.
-
getInteger
public int getInteger(String name)
Description copied from interface:IParametersGets the integer value for a given parameter name.- Specified by:
getIntegerin interfaceIParameters- Parameters:
name- the name of the integer parameter to retrieve.- Returns:
- the value of the given parameter, or 0 if it is not defined.
-
setInteger
public void setInteger(String name, int value)
Description copied from interface:IParametersSets the integer value for a given parameter name.- Specified by:
setIntegerin interfaceIParameters- Parameters:
name- the name of the parameter to set.value- the new value to set.
-
getParametersDescription
public ParametersDescription getParametersDescription()
Description copied from interface:IParametersGets the description of the parameters.- Specified by:
getParametersDescriptionin interfaceIParameters- Returns:
- the ParametersDescription object for this set of parameters, or null if none is provided.
-
getSimplifierRules
public String getSimplifierRules()
-
setSimplifierRules
public void setSimplifierRules(String simplifierRules)
-
-