|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.tools.generic.SafeConfig
org.apache.velocity.tools.generic.EscapeTool
com.evanmclean.evlib.velocity.tools.EscapeTool
public class EscapeTool
Extends the velocity tools EscapeTool with extra things that can be escaped.
Field Summary |
---|
Fields inherited from class org.apache.velocity.tools.generic.EscapeTool |
---|
DEFAULT_KEY |
Fields inherited from class org.apache.velocity.tools.generic.SafeConfig |
---|
LOCK_CONFIG_KEY, OLD_LOCK_CONFIG_KEY, SAFE_MODE_KEY |
Constructor Summary | |
---|---|
EscapeTool()
|
Method Summary | |
---|---|
String |
cdata(Object obj)
Return the string with any characters that require escaping done to make it safe for use in XML CDATA text. |
String |
csv(Object obj)
Makes a string safe to use as a field within a comma separated (CSV) file. |
String |
html(Object obj)
Return the string with any characters that require escaping done to make it safe for use in HTML text. |
String |
htmlAttr(Object obj)
Return the string with any characters that require escaping done to make it safe for an HTML attribute. |
String |
htmlBr(Object obj)
Return the string with any characters that require escaping done to make it safe for use in HTML text. |
String |
htmlComment(Object obj)
Return the string with any characters that require escaping done to make it safe for use in an HTML comment. |
String |
java(Object obj)
Makes a string safe to use as a string literal inside a piece of Java code (does not add enclosing double quotes). |
String |
javascript(Object obj)
Makes a string safe to use as a string literal inside a piece of Javascript code (does not add enclosing double quotes). |
String |
url(Object obj)
Return the string with any characters that require escaping done to make it safe for a URL argument. |
String |
xml(Object obj)
Return the string with any characters that require escaping done to make it safe for use in XML text. |
String |
xmlAttr(Object obj)
Return the string with any characters that require escaping done to make it safe for an XML attribute. |
String |
xmlComment(Object obj)
Return the string with any characters that require escaping done to make it safe for use in an XML comment. |
Methods inherited from class org.apache.velocity.tools.generic.EscapeTool |
---|
configure, dumpString, getB, getBackslash, getD, getDollar, getE, getExclamation, getH, getHash, getKey, getN, getNewline, getQ, getQuote, getS, getSingleQuote, propertyKey, propertyValue, setKey, sql, unicode, velocity |
Methods inherited from class org.apache.velocity.tools.generic.SafeConfig |
---|
configure, isConfigLocked, isSafeMode, setLockConfig, setSafeMode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EscapeTool()
Method Detail |
---|
public String cdata(Object obj)
Return the string with any characters that require escaping done to make it safe for use in XML CDATA text. Null returns null.
obj
- The string to make safe.
public String csv(Object obj)
Makes a string safe to use as a field within a comma separated (CSV) file. Null returns null.
obj
- The string to make safe.
public String html(Object obj)
Return the string with any characters that require escaping done to make it safe for use in HTML text. Null returns null.
html
in class EscapeTool
obj
- The string to make safe.
public String htmlAttr(Object obj)
obj
- The string to make safe.
public String htmlBr(Object obj)
obj
- The string to make safe.
public String htmlComment(Object obj)
Return the string with any characters that require escaping done to make it safe for use in an HTML comment. Null returns null.
obj
- The string to make safe.
public String java(Object obj)
Makes a string safe to use as a string literal inside a piece of Java code (does not add enclosing double quotes). Null returns null.
java
in class EscapeTool
obj
- The string to make safe.
public String javascript(Object obj)
Makes a string safe to use as a string literal inside a piece of Javascript code (does not add enclosing double quotes). Null returns null.
javascript
in class EscapeTool
obj
- The string to make safe.
public String url(Object obj)
url
in class EscapeTool
obj
- The string to make safe.
RuntimeException
- In the extremely unlikely event that your JVM doesn't know how to
do UTF-8 encoding, we rethrow the UnsupportedEncodingException as a
RuntimeException instead. Should never happen.public String xml(Object obj)
Return the string with any characters that require escaping done to make it safe for use in XML text. Null returns null.
xml
in class EscapeTool
obj
- The string to make safe.
public String xmlAttr(Object obj)
obj
- The string to make safe.
public String xmlComment(Object obj)
Return the string with any characters that require escaping done to make it safe for use in an XML comment. Null returns null.
obj
- The string to make safe.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |