| java.lang.Object org.griphyn.common.util.Escape
Escape | public class Escape (Code) | | This class tries to define an interface to deal with quoting, escaping,
and the way back. The quoting algorithm is safe to only itself. Thus,
unescape( escape( s ) ) === s
holds true, but
escape( unescape( s ) ) =?= s
does not necessarily hold.
author: Gaurang Mehta author: Karan Vahi author: Jens-S. Vöckler version: $Revision: 50 $ |
Constructor Summary | |
public | Escape() Defines the default quoting and escaping rules, escaping the
apostrophe, double quote and backslash. | public | Escape(String escapable, char escape) Constructs arbitrary escaping rules. |
Method Summary | |
public String | escape(String s) Transforms a given string by escaping all characters inside the
quotable characters set with the escape character. | public static void | main(String args) Test program. | public String | unescape(String s) Transforms a given string by unescaping all characters that
are prefixed with the escape character. |
Escape | public Escape()(Code) | | Defines the default quoting and escaping rules, escaping the
apostrophe, double quote and backslash. The escape character
is the backslash.
|
Escape | public Escape(String escapable, char escape)(Code) | | Constructs arbitrary escaping rules.
Parameters: escapable - is the set of characters that require escaping Parameters: escape - is the escape character itself. |
escape | public String escape(String s)(Code) | | Transforms a given string by escaping all characters inside the
quotable characters set with the escape character. The escape
character itself is also escaped.
Parameters: s - is the string to escape. the quoted string See Also: Escape.unescape(String) |
main | public static void main(String args)(Code) | | Test program.
Parameters: args - are command-line arguments |
unescape | public String unescape(String s)(Code) | | Transforms a given string by unescaping all characters that
are prefixed with the escape character.
Parameters: s - is the string to remove escapes from. the quoted string See Also: Escape.unescape(String) |
|
|