com.evanmclean.evlib.escape
Class EscUrl

java.lang.Object
  extended by com.evanmclean.evlib.escape.EscUrl

public final class EscUrl
extends Object

Makes a string safe to use as a URL parameter.

Author:
Evan McLean McLean Computer Services (see the overview for copyright and licensing.)

Method Summary
 String text(Object obj)
           Makes a string safe to use as a URL parameter.
 String text(Object obj, Charset cs)
           Makes a string safe to use as a URL parameter.
 String text(Object obj, String charset)
           Makes a string safe to use as a URL parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

text

public String text(Object obj)

Makes a string safe to use as a URL parameter. Uses UTF-8 encoding for extended unicode characters if necessary. This is the one you'll probably use most of the time.

Parameters:
obj -
Returns:
The substituted string, or null if obj was null.

text

public String text(Object obj,
                   Charset cs)

Makes a string safe to use as a URL parameter. Uses the specified character set for encoding extended unicode characters if necessary.

Parameters:
obj -
cs - The character set to use.
Returns:
The substituted string, or null if obj was null.

text

public String text(Object obj,
                   String charset)

Makes a string safe to use as a URL parameter. Uses the specified character set for encoding extended unicode characters if necessary.

Parameters:
obj -
charset - The character set to use.
Returns:
The substituted string, or null if obj was null.