net.sf.jasperreports.engine.util
Class JRStringUtil
java.lang.Object
net.sf.jasperreports.engine.util.JRStringUtil
public class JRStringUtil
- extends java.lang.Object
- Version:
- $Id: JRStringUtil.java 3034 2009-08-27 11:58:04Z teodord $
- Author:
- Teodor Danciu ([email protected])
Method Summary |
static java.lang.String |
escapeJavaStringLiteral(java.lang.String text)
Escapes a text so that it can be used as a Java String literal. |
static java.lang.String |
getLiteral(java.lang.String name)
Takes a name and returns the same if it is a Java identifier;
else it substitutes the illegal characters so that it can be an identifier |
static java.lang.String |
htmlEncode(java.lang.String text)
|
static java.lang.String |
replaceCRwithLF(java.lang.String text)
This method replaces all occurrences of the CR character with the LF character,
except when the CR is immediately followed by a LF (CRLF sequences), in which case the CR is removed. |
static java.lang.String |
xmlEncode(java.lang.String text)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JAVA_IDENTIFIER_PREFIX
protected static final java.lang.String JAVA_IDENTIFIER_PREFIX
- See Also:
- Constant Field Values
JRStringUtil
public JRStringUtil()
replaceCRwithLF
public static java.lang.String replaceCRwithLF(java.lang.String text)
- This method replaces all occurrences of the CR character with the LF character,
except when the CR is immediately followed by a LF (CRLF sequences), in which case the CR is removed.
xmlEncode
public static java.lang.String xmlEncode(java.lang.String text)
htmlEncode
public static java.lang.String htmlEncode(java.lang.String text)
getLiteral
public static java.lang.String getLiteral(java.lang.String name)
- Takes a name and returns the same if it is a Java identifier;
else it substitutes the illegal characters so that it can be an identifier
- Parameters:
name
-
escapeJavaStringLiteral
public static java.lang.String escapeJavaStringLiteral(java.lang.String text)
- Escapes a text so that it can be used as a Java String literal.
- Parameters:
text
- the text
- Returns:
- the text with escaped quotes and backslashes
Copyright © 2010. All Rights Reserved.