Package net.sf.okapi.common
Interface IParameters
-
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
AbstractGroupParameters
,AbstractMarkupParameters
,AutoXLIFFParameters
,BaseParameters
,CompoundFilterParameters
,ConditionalParameters
,DefaultParameters
,ExtractionVerificationStepParameters
,FilterWriterParameters
,GoogleAutoMLTranslationParameters
,GoogleMTv2Parameters
,KantanMTv21ConnectorParameters
,MergingParameters
,Options
,Options
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,Parameters
,ParametersSimpleWordCountStep
,StringParameters
,SubtitleParameters
,TableFilterWriterParameters
,TerminologyParameters
,TokenConfigs
,TokenConfigs.TokenConfig
,TTMLParameters
,TTXJoinerParameters
,TTXSplitterParameters
,VTTParameters
,WhitespaceCorrectionStepParameters
,XLIFF2Options
,XliffJoinerParameters
,XliffSplitterParameters
,XliffWCSplitterParameters
,XLIFFWriterParameters
,XMLEncoder.Parameters
,YamlParameters
public interface IParameters extends Cloneable
Common way for a component to expose its parameters in a generic way.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default IParameters
copy()
Creates a new IParameters object and populates it with the parametersvoid
fromString(String data)
Parses the parameters stored into a string back into the object.boolean
getBoolean(String name)
Gets the boolean value for the given parameter name.int
getInteger(String name)
Gets the integer value for a given parameter name.ParametersDescription
getParametersDescription()
Gets the description of the parameters.String
getPath()
Gets the full path of the last file where the parameters where loaded from or saved to.String
getString(String name)
Gets the string value for a given parameter name.void
load(InputStream inStream, boolean ignoreErrors)
Loads the parameters from a file.void
load(URL inputURL, boolean ignoreErrors)
Loads the parameters from a file.void
reset()
Reset the parameters to their default values.void
save(String filePath)
Saves the parameters to a file.void
setBoolean(String name, boolean value)
Sets the boolean value for a given parameter name.void
setInteger(String name, int value)
Sets the integer value for a given parameter name.void
setPath(String filePath)
Sets the full path of the file where the parameters are to be saved to.void
setString(String name, String value)
Sets the string value for a given parameter name.String
toString()
Converts the parameters into a string.
-
-
-
Method Detail
-
copy
default IParameters copy()
Creates a new IParameters object and populates it with the parameters
-
reset
void reset()
Reset the parameters to their default values.
-
toString
String toString()
Converts the parameters into a string.
-
fromString
void fromString(String data)
Parses the parameters stored into a string back into the object.- 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.
-
load
void load(URL inputURL, boolean ignoreErrors)
Loads the parameters from a file.- 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
void load(InputStream inStream, boolean ignoreErrors)
Loads the parameters from a file.- 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.
-
save
void save(String filePath)
Saves the parameters to a file.- Parameters:
filePath
- the full path of the parameters file to save.
-
getPath
String getPath()
Gets the full path of the last file where the parameters where loaded from or saved to.- Returns:
- the full path of the last load() or save(), or null if object was not loaded nor saved.
-
setPath
void setPath(String filePath)
Sets the full path of the file where the parameters are to be saved to.- Parameters:
filePath
- the full path to set.
-
getBoolean
boolean getBoolean(String name)
Gets the boolean value for the given parameter name.- 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
void setBoolean(String name, boolean value)
Sets the boolean value for a given parameter name.- Parameters:
name
- the name of the parameter to set.value
- the new value to set.
-
getString
String getString(String name)
Gets the string value for a given parameter name.- 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
void setString(String name, String value)
Sets the string value for a given parameter name.- Parameters:
name
- the name of the parameter to set.value
- the new value to set.
-
getInteger
int getInteger(String name)
Gets the integer value for a given parameter name.- 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
void setInteger(String name, int value)
Sets the integer value for a given parameter name.- Parameters:
name
- the name of the parameter to set.value
- the new value to set.
-
getParametersDescription
ParametersDescription getParametersDescription()
Gets the description of the parameters.- Returns:
- the ParametersDescription object for this set of parameters, or null if none is provided.
-
-