com.ls.util.text
Class EncoderDecoder

java.lang.Object
  |
  +--com.ls.util.text.EncoderDecoder

public class EncoderDecoder
extends Object


Constructor Summary
EncoderDecoder()
           
 
Method Summary
static String decode(String sourceString, char[] charsToDecode, String[] decodeString)
          decodes the value of the variables before they get displayed in the template
static String decode(String sourceString, int decodeType)
          decodes the value of the variables before they get displayed in the template
static String encode(String sourceString, char[] charsToEncode, String[] encodeString)
          encodes the values of the variables before they get displayed in the template
static String encode(String sourceString, int encodeType)
          encodes the values of the variables before they get displayed in the template
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncoderDecoder

public EncoderDecoder()
Method Detail

encode

public static String encode(String sourceString,
                            int encodeType)
                     throws InvalidArgumentException,
                            MissingDataException
encodes the values of the variables before they get displayed in the template
Parameters:
sourceString - The source which has to be encoded
encodeType - The type of encoding (like ESCAPE,URL,..)
Returns:
the encoded source string
Throws:
InvalidArgumentException - If any of the parameter is null
MissingDataException - If the encode type is unkown

encode

public static String encode(String sourceString,
                            char[] charsToEncode,
                            String[] encodeString)
                     throws InvalidArgumentException
encodes the values of the variables before they get displayed in the template
Parameters:
sourceString - The source which has to be encoded
charsToEncode - the chracter set which need to be encoded
encodeString - the encode string set
Returns:
the encoded source string
Throws:
InvalidArgumentException - If any of the parameter is null

decode

public static String decode(String sourceString,
                            int decodeType)
                     throws InvalidArgumentException,
                            MissingDataException
decodes the value of the variables before they get displayed in the template
Parameters:
sourceString - The source which has to be docoded
decodeType - The type of decoding (like ESCAPE,URL,..)
Returns:
the decoded source string
Throws:
InvalidArgumentException - If any of the parameter is null
MissingDataException - If the decode type is unkown

decode

public static String decode(String sourceString,
                            char[] charsToDecode,
                            String[] decodeString)
                     throws InvalidArgumentException
decodes the value of the variables before they get displayed in the template
Parameters:
sourceString - The source which has to be docoded
charsToDecode - the chracter set which need to be decoded
decodeString - the decode string set
Returns:
the decoded source string
Throws:
InvalidArgumentException - If any of the parameter is null