Package net.sf.okapi.filters.mif
Class MIFEncoder
- java.lang.Object
-
- net.sf.okapi.filters.mif.MIFEncoder
-
-
Constructor Summary
Constructors Constructor Description MIFEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
encode(char value, EncoderContext context)
Encodes a given character with this encoding.String
encode(int value, EncoderContext context)
Encodes a given code-point with this encoding.String
encode(String text, EncoderContext context)
Encodes a given text with this encoder.CharsetEncoder
getCharsetEncoder()
Gets the character set encoder used for this encoder.String
getEncoding()
Gets the name of the charset encoding to use.String
getLineBreak()
Gets the line-break to use for this encoder.IParameters
getParameters()
Gets the parameters object with all the configuration information specific to this encoder.void
reset()
Reset state in this encoder in preparation for processing new content.void
setOptions(IParameters params, String encoding, String lineBreak)
Sets the options for this encoder.String
toNative(String propertyName, String value)
Converts any property values from its standard representation to the native representation for this encoder.
-
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:IEncoder
Reset state in this encoder in preparation for processing new content.
-
setOptions
public void setOptions(IParameters params, String encoding, String lineBreak)
Description copied from interface:IEncoder
Sets the options for this encoder.- Specified by:
setOptions
in interfaceIEncoder
- Parameters:
params
- the parameters object with all the configuration information specific to this encoder.encoding
- the name of the charset encoding to use.lineBreak
- the type of line break to use.
-
encode
public String encode(String text, EncoderContext context)
Description copied from interface:IEncoder
Encodes a given text with this encoder.
-
encode
public String encode(char value, EncoderContext context)
Description copied from interface:IEncoder
Encodes a given character with this encoding.
-
encode
public String encode(int value, EncoderContext context)
Description copied from interface:IEncoder
Encodes a given code-point with this encoding. If this method is called from a loop it is assumed that the code point is tested by the caller to know if it is a supplemental one or not and and any index update to skip the low surrogate part of the pair is done on the caller side.
-
toNative
public String toNative(String propertyName, String value)
Description copied from interface:IEncoder
Converts any property values from its standard representation to the native representation for this encoder.
-
getLineBreak
public String getLineBreak()
Description copied from interface:IEncoder
Gets the line-break to use for this encoder.- Specified by:
getLineBreak
in interfaceIEncoder
- Returns:
- the line-break used for this encoder.
-
getCharsetEncoder
public CharsetEncoder getCharsetEncoder()
Description copied from interface:IEncoder
Gets the character set encoder used for this encoder.- Specified by:
getCharsetEncoder
in interfaceIEncoder
- Returns:
- the character set encoder used for this encoder. This can be null.
-
getParameters
public IParameters getParameters()
Description copied from interface:IEncoder
Gets the parameters object with all the configuration information specific to this encoder.- Specified by:
getParameters
in interfaceIEncoder
- Returns:
- the parameters object used for this encoder. This can be null.
-
getEncoding
public String getEncoding()
Description copied from interface:IEncoder
Gets the name of the charset encoding to use.- Specified by:
getEncoding
in interfaceIEncoder
- Returns:
- the charset encoding used for this encoder.
-
-