|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.okapi.common.encoder.EncoderManager
public class EncoderManager
Provides caching and lookup mechanism for the text encoders used when writing out text processed by a filter.
| Constructor Summary | |
|---|---|
EncoderManager()
Creates a new encoder manager, with default pre-defined encoder loaded. |
|
| Method Summary | |
|---|---|
void |
clearMap()
Clears all encoders from the manager. |
java.lang.String |
encode(char value,
EncoderContext context)
Encodes a given character with the encoder currently cached. |
java.lang.String |
encode(int codePoint,
EncoderContext context)
Encodes a given code-point with the encoder currently cached. |
java.lang.String |
encode(java.lang.String text,
EncoderContext context)
Encodes a given text with the encoder currently cached. |
java.nio.charset.CharsetEncoder |
getCharsetEncoder()
Gets the character set encoder used for this encoder. |
IEncoder |
getEncoder()
Gets the encoder currently cached by this manager. |
java.lang.String |
getLineBreak()
Gets the line-break to use for this encoder. |
void |
mergeMappings(EncoderManager otherManager)
Adds the mappings of a given encoder manager into this manager. |
void |
removeMapping(java.lang.String mimeType)
Removes a given mapping from the manager. |
void |
setAllKnownMappings()
Sets all mappings known by the core libraries. |
void |
setDefaultOptions(IParameters params,
java.lang.String encoding,
java.lang.String lineBreak)
Sets the default options for this encoder manager. |
void |
setMapping(java.lang.String mimeType,
IEncoder encoder)
|
void |
setMapping(java.lang.String mimeType,
java.lang.String className)
Sets a mapping in the manager. |
void |
setOptions(IParameters params,
java.lang.String encoding,
java.lang.String lineBreak)
Sets the options for the encoder currently cached. |
java.lang.String |
toNative(java.lang.String propertyName,
java.lang.String value)
Converts any property values from its standard representation to the native representation for this encoder. |
void |
updateEncoder(java.lang.String newMimeType)
Updates the current cached encoder for this manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EncoderManager()
| Method Detail |
|---|
public void setAllKnownMappings()
public void clearMap()
public void setMapping(java.lang.String mimeType,
java.lang.String className)
mimeType - The MIME type identifier for this mapping.className - The class name of the encoder to use.
public void setMapping(java.lang.String mimeType,
IEncoder encoder)
public void removeMapping(java.lang.String mimeType)
mimeType - The MIME type identifier of the mapping to remove.public void mergeMappings(EncoderManager otherManager)
otherManager - the other encoder manager.public void updateEncoder(java.lang.String newMimeType)
setDefaultOptions(IParameters, String, String) must have been called
before calling this method.
newMimeType - The MIME type identifier for the encoder to use now. If there is no mapping for the
given MIME type, the cache is cleared and no encoder is active.
public java.lang.String encode(java.lang.String text,
EncoderContext context)
encode in interface IEncodertext - The text to encode.context - The context of the text: 0=text, 1=skeleton, 2=inline.
public java.lang.String encode(char value,
EncoderContext context)
encode in interface IEncodervalue - The character to encode.context - The context of the character: 0=text, 1=skeleton, 2=inline.
public java.lang.String encode(int codePoint,
EncoderContext context)
encode in interface IEncodercodePoint - The code-point to encode.context - The context of the character: 0=text, 1=skeleton, 2=inline.
public IEncoder getEncoder()
public void setOptions(IParameters params,
java.lang.String encoding,
java.lang.String lineBreak)
setOptions in interface IEncoderparams - The parameters object with all the configuration information
specific to this encoder.encoding - The name of the charset encoding to use.lineBreak - Type of line-break to use in the output.
public java.lang.String toNative(java.lang.String propertyName,
java.lang.String value)
IEncoder
toNative in interface IEncoderpropertyName - the name of the property.value - the standard value to convert.
public void setDefaultOptions(IParameters params,
java.lang.String encoding,
java.lang.String lineBreak)
params - The default parameter object.encoding - The default encoding.public java.lang.String getLineBreak()
IEncoder
getLineBreak in interface IEncoderpublic java.nio.charset.CharsetEncoder getCharsetEncoder()
IEncoder
getCharsetEncoder in interface IEncoder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||