public class MapCloudhopperCharsetHandler extends Object implements CloudhopperCharsetHandler
CloudhopperCharsetHandler
.Constructor and Description |
---|
MapCloudhopperCharsetHandler(CharsetProvider charsetProvider) |
MapCloudhopperCharsetHandler(CharsetProvider charsetProvider,
Map<String,String> mapCloudhopperNameByNioName)
Initializes with the map of
Charset code handlers indexed indexed
by the NIO Charset code. |
Modifier and Type | Method and Description |
---|---|
void |
addCharset(String nioCharsetName,
com.cloudhopper.commons.charset.Charset cloudhopperCharset)
Add a charset mapping.
|
void |
addCharset(String nioCharsetName,
String cloudhopperCharsetName)
Add a charset mapping.
|
byte[] |
encode(String messageStringContent)
Encodes the message string content after a charset detection.
|
public MapCloudhopperCharsetHandler(CharsetProvider charsetProvider)
public MapCloudhopperCharsetHandler(CharsetProvider charsetProvider, Map<String,String> mapCloudhopperNameByNioName) throws EncodingException
Charset
code handlers indexed indexed
by the NIO Charset
code.charsetProvider
- the charset provider that gives a charset for the messagemapCloudhopperNameByNioName
- the map of content handlers indexed by the content classEncodingException
- If the map contains any invalid cloudhopper charset namepublic void addCharset(String nioCharsetName, String cloudhopperCharsetName) throws EncodingException
nioCharsetName
- Java NIO charset namecloudhopperCharsetName
- Cloudhopper charset nameEncodingException
- If Cloudhopper charset name is invalidCharsetUtil
public void addCharset(String nioCharsetName, com.cloudhopper.commons.charset.Charset cloudhopperCharset)
nioCharsetName
- Java NIO charset namecloudhopperCharset
- Cloudhopper charsetpublic byte[] encode(String messageStringContent) throws EncodingException
CloudhopperCharsetHandler
encode
in interface CloudhopperCharsetHandler
messageStringContent
- the message as string to encodeEncodingException
- when message can't be encodedCopyright © 2017. All rights reserved.