org.springframework.extensions.surf.util
Class EncodingUtil

java.lang.Object
  extended by org.springframework.extensions.surf.util.EncodingUtil

public class EncodingUtil
extends Object

Provides helper methods for encoding and decoding strings into a given encoding scheme.

Author:
muzquiano

Field Summary
static String DEFAULT_ENCODING
          The DEFAULT encoding.
 
Constructor Summary
EncodingUtil()
           
 
Method Summary
static String decode(String input)
          Decode.
static String decode(String input, String encoding)
          Decode.
static String encode(String input)
          Encodes the given String into the default encoding.
static String encode(String input, String encoding)
          Encodes the given String into the given encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
The DEFAULT encoding.

See Also:
Constant Field Values
Constructor Detail

EncodingUtil

public EncodingUtil()
Method Detail

encode

public static String encode(String input)
Encodes the given String into the default encoding. The default encoding is specified by DEFAULT_ENCODING. If the encoding is unable to be performed, null is returned.

Parameters:
input - The String to be encoded
Returns:
The encoded String

encode

public static String encode(String input,
                            String encoding)
Encodes the given String into the given encoding. If the encoding is unable to be performed, null is returned.

Parameters:
input - The String to be encoded
encoding - The encoding to be used
Returns:
The encoded String

decode

public static String decode(String input)
Decode.

Parameters:
input - the input
Returns:
the string

decode

public static String decode(String input,
                            String encoding)
Decode.

Parameters:
input - the input
encoding - the encoding
Returns:
the string


Copyright © 2009 SpringSource, Inc. All Rights Reserved.