|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.xom.StringEscaper
public class StringEscaper
StringEscaper
is a utility for replacing special characters
with escape sequences in strings. Initially, a StringEscaper starts out as
an identity transform in the "mutable" state. Call defineEscape as many
times as necessary to set up mappings, and then call makeImmutable() before
using appendEscapedString to actually apply the defined transform. Or, use one of
the global mappings pre-defined here.
Field Summary | |
---|---|
static StringEscaper |
htmlEscaper
|
static StringEscaper |
urlArgEscaper
|
static StringEscaper |
urlEscaper
|
static StringEscaper |
xmlEscaper
|
static StringEscaper |
xmlNumericEscaper
|
Constructor Summary | |
---|---|
StringEscaper()
Identity transform |
Method Summary | |
---|---|
void |
appendEscapedString(String s,
StringBuffer sb)
Apply an immutable transformation to the given string, writing the results to a string buffer. |
protected Object |
clone()
|
void |
defineEscape(char from,
String to)
Map character "from" to escape sequence "to" |
String |
escapeString(String s)
Apply an immutable transformation to the given string. |
StringEscaper |
getMutableClone()
Create a mutable escaper from an existing escaper, which may already be immutable. |
void |
makeImmutable()
Call this before attempting to escape strings; after this, defineEscape may not be called again. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static StringEscaper xmlEscaper
public static StringEscaper xmlNumericEscaper
public static StringEscaper htmlEscaper
public static StringEscaper urlArgEscaper
public static StringEscaper urlEscaper
Constructor Detail |
---|
public StringEscaper()
Method Detail |
---|
public void defineEscape(char from, String to)
public void makeImmutable()
public String escapeString(String s)
public void appendEscapedString(String s, StringBuffer sb)
protected Object clone()
clone
in class Object
public StringEscaper getMutableClone()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |