Package net.sf.okapi.common.encoder
Class MarkdownEncoder
- java.lang.Object
-
- net.sf.okapi.common.encoder.DefaultEncoder
-
- net.sf.okapi.common.encoder.MarkdownEncoder
-
public class MarkdownEncoder extends DefaultEncoder
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_CHARACTERS_TO_ESCAPE
-
Constructor Summary
Constructors Constructor Description MarkdownEncoder()
-
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.IParameters
getParameters()
Gets the parameters object with all the configuration information specific to this encoder.void
setOptions(IParameters params, String encoding, String lineBreak)
Sets the options for this encoder.-
Methods inherited from class net.sf.okapi.common.encoder.DefaultEncoder
getCharsetEncoder, getEncoding, getLineBreak, reset, setLineBreak, toNative
-
-
-
-
Field Detail
-
DEFAULT_CHARACTERS_TO_ESCAPE
public static final String DEFAULT_CHARACTERS_TO_ESCAPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
- Overrides:
setOptions
in classDefaultEncoder
- 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.- Specified by:
encode
in interfaceIEncoder
- Overrides:
encode
in classDefaultEncoder
- Parameters:
text
- the text to encode.context
- the context of the text: 0=text, 1=skeleton, 2=inline.- Returns:
- the encoded text.
-
encode
public String encode(char value, EncoderContext context)
Description copied from interface:IEncoder
Encodes a given character with this encoding.- Specified by:
encode
in interfaceIEncoder
- Overrides:
encode
in classDefaultEncoder
- Parameters:
value
- the character to encode.context
- the context of the character: 0=text, 1=skeleton, 2=inline.- Returns:
- the encoded character 9as a string since it can be now made up of more than one character).
-
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.- Specified by:
encode
in interfaceIEncoder
- Overrides:
encode
in classDefaultEncoder
- Parameters:
value
- the code-point to encode.context
- the context of the character: 0=text, 1=skeleton, 2=inline.- Returns:
- the encoded character (as a string since it can be now made up of more than one character).
-
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
- Overrides:
getParameters
in classDefaultEncoder
- Returns:
- the parameters object used for this encoder. This can be null.
-
-