igpp.util
Class Encode

java.lang.Object
  extended by igpp.util.Encode

public class Encode
extends Object

Methods to encode a string for a particular environment. Supports encoding for SQL, URL and HTML uses.

Version:
1.00 2006
Author:
Todd King

Constructor Summary
Encode()
           
 
Method Summary
static String htmlDecode(String term)
          Convert special characters in a string for display as HTML document.
static String htmlEncode(String term)
          Convert special characters in a string for use in an HTML document.
static String regexEncode(String term)
          Convert a string with convention wild cards to Regular Expression (regex) equivalents.
static String sqlEncode(String term)
          Convert a string with convention wild cards to SQL equivalents.
static String urlDecode(String term)
          Convert special characters in a string for use in an URL.
static String urlEncode(String term)
          Convert special characters in a string for use in an URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encode

public Encode()
Method Detail

sqlEncode

public static String sqlEncode(String term)
Convert a string with convention wild cards to SQL equivalents.

Parameters:
term - the text to encode.
Returns:
the encoded text.

regexEncode

public static String regexEncode(String term)
Convert a string with convention wild cards to Regular Expression (regex) equivalents.

Parameters:
term - the text to encode.
Returns:
the encoded text.

urlEncode

public static String urlEncode(String term)
Convert special characters in a string for use in an URL.

Parameters:
term - the text to encode.
Returns:
the encoded text.

urlDecode

public static String urlDecode(String term)
Convert special characters in a string for use in an URL.

Parameters:
term - the text to decode.
Returns:
the decoded text.

htmlEncode

public static String htmlEncode(String term)
Convert special characters in a string for use in an HTML document.

Parameters:
term - the text to encode.
Returns:
the encoded text.

htmlDecode

public static String htmlDecode(String term)
Convert special characters in a string for display as HTML document.

Parameters:
term - the text to decode.
Returns:
the decoded text.


Copyright © 2008-2009 Regents University of California. All Rights Reserved.