net.sf.jasperreports.engine.util
Class JRStringUtil

java.lang.Object
  extended by net.sf.jasperreports.engine.util.JRStringUtil

public final class JRStringUtil
extends Object

Version:
$Id: JRStringUtil.java 5397 2012-05-21 01:10:02Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
protected static String JAVA_IDENTIFIER_PREFIX
           
 
Method Summary
static String escapeJavaScript(String input)
          Escapes a text so that it can be used as a Java String literal.
static String escapeJavaStringLiteral(String text)
          Escapes a text so that it can be used as a Java String literal.
static String getJavaIdentifier(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 String getString(Object value)
           
static List<Integer> getTabIndexes(String text)
           
static String htmlEncode(String text)
           
static String replaceCRwithLF(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 String xmlEncode(String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_IDENTIFIER_PREFIX

protected static final String JAVA_IDENTIFIER_PREFIX
See Also:
Constant Field Values
Method Detail

replaceCRwithLF

public static String replaceCRwithLF(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 String xmlEncode(String text)

htmlEncode

public static String htmlEncode(String text)

getJavaIdentifier

public static String getJavaIdentifier(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 String escapeJavaStringLiteral(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

escapeJavaScript

public static String escapeJavaScript(String input)
Escapes a text so that it can be used as a Java String literal.

Parameters:
input -

getTabIndexes

public static List<Integer> getTabIndexes(String text)

getString

public static String getString(Object value)


Copyright © 2012. All Rights Reserved.