org.jbehave.core.i18n
Class StringCoder

java.lang.Object
  extended by org.jbehave.core.i18n.StringCoder

public class StringCoder
extends java.lang.Object

Supports encoding and decoding of strings using specified charsets.


Nested Class Summary
static class StringCoder.InvalidEncodingException
           
static class StringCoder.Mode
           
 
Constructor Summary
StringCoder()
          Creates a StringCoder using Charset.defaultCharset().name()
StringCoder(java.lang.String charsetName)
          Creates a StringCoder using the specified charset
 
Method Summary
 java.lang.String canonicalize(java.lang.String input)
          Encodes and decodes input using the coder charset
 java.lang.String getCharsetName()
           
 boolean isCharsetSupported()
           
 void validateEncoding(java.lang.String input, StringCoder.Mode mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringCoder

public StringCoder()
Creates a StringCoder using Charset.defaultCharset().name()


StringCoder

public StringCoder(java.lang.String charsetName)
Creates a StringCoder using the specified charset

Parameters:
charsetName - the name of the charset
Method Detail

getCharsetName

public java.lang.String getCharsetName()

isCharsetSupported

public boolean isCharsetSupported()

canonicalize

public java.lang.String canonicalize(java.lang.String input)
Encodes and decodes input using the coder charset

Parameters:
input - the String input
Returns:
String after encoding and decoding
Throws:
StringCoder.InvalidEncodingException - if encoding is not supported for charset

validateEncoding

public void validateEncoding(java.lang.String input,
                             StringCoder.Mode mode)


Copyright © 2003-2010. All Rights Reserved.