Package net.sf.jasperreports.engine.util
Class JRStringUtil
java.lang.Object
net.sf.jasperreports.engine.util.JRStringUtil
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringcssClassReplacement(String text) static StringencodeXmlAttribute(String text) static StringencodeXmlAttribute(String text, boolean exceptApos) static StringescapeJavaScript(String input) Escapes a text so that it can be used as a Java String literal.static StringEscapes a text so that it can be used as a Java String literal.static StringescapeJSONString(String text) Escapes a text to be used for a JSON string value.static StringescapeString4JavaScript(String input) Escapes a Java String so that it can be used as a JavaScript String literal.static StringgetCSSClass(String name) static StringgetJavaIdentifier(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 identifierstatic StringgetLetterNumeral(int number, boolean isUpperCase) static StringgetRomanNumeral(int number, boolean isUpperCase) static StringgetTabIndexes(String text) static StringhtmlEncode(String text) static StringreplaceCRwithLF(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 Stringstatic String
-
Field Details
-
JAVA_IDENTIFIER_PREFIX
- See Also:
-
PATTERN_CSS_INVALID_CHARACTER
-
HEX_DIGITS
protected static final char[] HEX_DIGITS -
EXCEPTION_MESSAGE_KEY_NUMBER_OUTSIDE_BOUNDS
- See Also:
-
THOUSAND_DIGITS
-
HUNDRED_DIGITS
-
TEN_DIGITS
-
UNIT_DIGITS
-
-
Method Details
-
replaceCRwithLF
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
-
xmlEncode
-
encodeXmlAttribute
-
encodeXmlAttribute
-
htmlEncode
-
getJavaIdentifier
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
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
Escapes a text so that it can be used as a Java String literal.- Parameters:
input-
-
escapeString4JavaScript
Escapes a Java String so that it can be used as a JavaScript String literal.- Parameters:
input-
-
getTabIndexes
-
split
-
getString
-
escapeJSONString
Escapes a text to be used for a JSON string value.- Parameters:
text- the text to escape for JSON- Returns:
- the escaped text if not null
-
getCSSClass
-
cssClassReplacement
-
getLetterNumeral
-
getRomanNumeral
- Parameters:
number- an integer value between 1 and 3999isUpperCase- specifies whether the result should be made of upper case characters- Returns:
- the Roman numeral representation of this number
-