|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.evanmclean.evlib.escape.Esc
public final class Esc
Provides worker objects that can perform character escapes on strings to make them safe for various output (e.g. HTML, XML, Javascript).
The only difference between the
html
escape objects and their xhtml
equivalents is
that the EscHtml.textbr(Object)
methods inserts a "
<br>
for HTML, and a "<br/>
"
for XHTML.
Field Summary | |
---|---|
static EscCsv |
csv
Makes a string safe to use as a field within a comma separated (CSV) file. |
static EscHtml |
html
HTML escaper that will convert the basic necessary characters required to make it safe for HTML (basically the < , > ,
" and & characters, plus unprintable
control characters). |
static EscHtml |
htmlAscii
HTML escaper that will convert any character that falls outside of the printable ASCII set (as well as the standard < ,
> , " and & characters). |
static EscHtml |
htmlFull
HTML escaper that will convert any character that has a standard HTML entity code equivalent. |
static EscHtml |
htmlMin
HTML escaper that will convert the absolute minimum characters required to make it safe for HTML (basically the < and
& characters, plus unprintable control characters). |
static EscJava |
java
Makes a string safe to use as a string literal inside a piece of Java code (does not add enclosing double quotes). |
static EscJavascript |
javascript
Makes a string safe to use as a string literal inside a piece of Javascript code (does not add enclosing double quotes). |
static EscUrl |
url
Makes a string safe to use as a URL parameter. |
static EscHtml |
xhtml
XHTML escaper that will convert the basic necessary characters required to make it safe for XHTML (basically the < , > ,
" and & characters, plus unprintable
control characters). |
static EscHtml |
xhtmlAscii
XHTML escaper that will convert any character that falls outside of the printable ASCII set (as well as the standard < ,
> , " and & characters). |
static EscHtml |
xhtmlFull
XHTML escaper that will convert any character that has a standard XHTML entity code equivalent. |
static EscXml |
xml
XML escaper that will convert the standard characters required to make it safe for XML (basically the < , > ,
" , ' and & characters, plus
unprintable control characters). |
static EscXml |
xmlAscii
XML escaper that will convert any character that falls outside of the printable ASCII set (as well as the standard < ,
> , " , ' and
& characters). |
Constructor Summary | |
---|---|
Esc()
|
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final EscCsv csv
Makes a string safe to use as a field within a comma separated (CSV) file.
Basically encapsulates the string in a pair of double-quotes if the string contains any of the following:
public static final EscHtml htmlMin
HTML escaper that will convert the absolute minimum characters required to
make it safe for HTML (basically the <
and
&
characters, plus unprintable control characters).
See note about HTML and XHTML.
public static final EscHtml html
HTML escaper that will convert the basic necessary characters required to
make it safe for HTML (basically the <
, >
,
"
and &
characters, plus unprintable
control characters). This is probably the one you'll want most of
the time.
See note about HTML and XHTML.
public static final EscHtml htmlAscii
HTML escaper that will convert any character that falls outside of the
printable ASCII set (as well as the standard <
,
>
, "
and &
characters).
See note about HTML and XHTML.
public static final EscHtml htmlFull
HTML escaper that will convert any character that has a standard HTML entity code equivalent. (e.g., "†" becomes "†".)
See note about HTML and XHTML.
public static final EscHtml xhtml
XHTML escaper that will convert the basic necessary characters required to
make it safe for XHTML (basically the <
, >
,
"
and &
characters, plus unprintable
control characters). This is probably the one you'll want most of
the time.
See note about HTML and XHTML.
public static final EscHtml xhtmlAscii
XHTML escaper that will convert any character that falls outside of the
printable ASCII set (as well as the standard <
,
>
, "
and &
characters).
See note about HTML and XHTML.
public static final EscHtml xhtmlFull
XHTML escaper that will convert any character that has a standard XHTML entity code equivalent. (e.g., "†" becomes "†".)
See note about HTML and XHTML.
public static final EscXml xml
XML escaper that will convert the standard characters required to make it
safe for XML (basically the <
, >
,
"
, '
and &
characters, plus
unprintable control characters). This is probably the one you'll
want most of the time.
public static final EscXml xmlAscii
XML escaper that will convert any character that falls outside of the
printable ASCII set (as well as the standard <
,
>
, "
, '
and
&
characters).
public static final EscUrl url
Makes a string safe to use as a URL parameter.
public static final EscJava java
Makes a string safe to use as a string literal inside a piece of Java code (does not add enclosing double quotes).
public static final EscJavascript javascript
Makes a string safe to use as a string literal inside a piece of Javascript code (does not add enclosing double quotes).
Constructor Detail |
---|
public Esc()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |