Class TextFunctions
- java.lang.Object
-
- net.sf.jasperreports.functions.AbstractFunctionSupport
-
- net.sf.jasperreports.functions.standard.TextFunctions
-
- All Implemented Interfaces:
FunctionSupport
public final class TextFunctions extends AbstractFunctionSupport
This class should maintain all function methods that belongs to the categoryTEXT(java.lang.Number, java.lang.String)
.- Author:
- Massimo Rabbi (mrabbi@users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description TextFunctions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
BASE(Integer number, Integer radix)
Returns a text representation of a number, in a specified base radix.static String
BASE(Integer number, Integer radix, Integer minlength)
static String
CHAR(Integer number)
Returns a single text character, given a character code.static String
CLEAN(String text)
Returns a new text string without non-printable characters.static Integer
CODE(String textString)
Returns the numeric code (0-255) for the first character in a string.static String
CONCATENATE(String... strings)
Combines a list of strings into a single one.static Double
DOUBLE_VALUE(String textNumber)
Returns a Double number representing the given text string.static Boolean
EXACT(String text1, String text2)
Returns TRUE if the two text specified are exactly the same (case sensitive compare).static Integer
FIND(String findText, String searchText)
Returns the character position of a string inside another text.static Integer
FIND(String findText, String searchText, Integer startPosition)
String
FIXED(Number number, Integer decimals)
Returns the text representing number with the specified decimal places.String
FIXED(Number number, Integer decimals, Boolean omitSeparators)
static Float
FLOAT_VALUE(String textNumber)
Returns a Float number representing the given text string.static Integer
INTEGER_VALUE(String textNumber)
Returns an Integer number representing the given text string.static String
LEFT(String text)
Returns the specified number of characters (1 by default) from the left side of the input text.static String
LEFT(String text, Integer charactersNum)
static Integer
LEN(String text)
Returns the length of the specified text string.static Long
LONG_VALUE(String textNumber)
Returns a Long number representing the given text string.static String
LOWER(String text)
Performs the lower case conversion of the specified text string.static String
LTRIM(String text)
Clear a string, removing leading whitespaces.static String
MID(String text, Integer startPosition)
Returns the text from the middle of a text string.static String
MID(String text, Integer startPosition, Integer charactersNum)
static String
PROPER(String text)
Capitalizes each words of the specified text.static String
REPLACE(String originalText, Integer startPosition, Integer charsNum, String newText)
Replaces parts of a text string with a different one.static String
REPT(String originalText, Integer numberOfTimes)
Replicates an input text string for a specified number of times.static String
RIGHT(String text)
Returns the specified number of characters (1 by default) from the right side of the input text.static String
RIGHT(String text, Integer charactersNum)
static String
RTRIM(String text)
Clear a string, removing trailing whitespaces.static Integer
SEARCH(String findText, String textToSearch)
Returns the position of a string of text in another string.static Integer
SEARCH(String findText, String textToSearch, Integer startPosition)
static String
SUBSTITUTE(String originalText, String oldText, String newText)
Substitutes new text for old text in a text string.static String
SUBSTITUTE(String originalText, String oldText, String newText, Integer occurrenceNum)
static String
T(Object value)
Returns the text string if the value is a string, otherwise an empty string is returned.String
TEXT(Number number, String numberFormat)
Converts a number into a text string according to a specified format.static String
TRIM(String text)
Clear a string,removing leading and trailing whitespaces.static String
UPPER(String text)
Performs the upper case conversion of the specified text string.-
Methods inherited from class net.sf.jasperreports.functions.AbstractFunctionSupport
getContext, init
-
-
-
-
Method Detail
-
BASE
public static String BASE(Integer number, Integer radix)
Returns a text representation of a number, in a specified base radix.
-
CHAR
public static String CHAR(Integer number)
Returns a single text character, given a character code.
-
CLEAN
public static String CLEAN(String text)
Returns a new text string without non-printable characters.
-
CODE
public static Integer CODE(String textString)
Returns the numeric code (0-255) for the first character in a string.
-
CONCATENATE
public static String CONCATENATE(String... strings)
Combines a list of strings into a single one.
-
EXACT
public static Boolean EXACT(String text1, String text2)
Returns TRUE if the two text specified are exactly the same (case sensitive compare).
-
DOUBLE_VALUE
public static Double DOUBLE_VALUE(String textNumber)
Returns a Double number representing the given text string.
-
FIND
public static Integer FIND(String findText, String searchText)
Returns the character position of a string inside another text. If the text is not found then -1 is returned.
-
FIXED
public String FIXED(Number number, Integer decimals)
Returns the text representing number with the specified decimal places.
-
FLOAT_VALUE
public static Float FLOAT_VALUE(String textNumber)
Returns a Float number representing the given text string.
-
INTEGER_VALUE
public static Integer INTEGER_VALUE(String textNumber)
Returns an Integer number representing the given text string.
-
LEFT
public static String LEFT(String text)
Returns the specified number of characters (1 by default) from the left side of the input text.
-
LONG_VALUE
public static Long LONG_VALUE(String textNumber)
Returns a Long number representing the given text string.
-
LOWER
public static String LOWER(String text)
Performs the lower case conversion of the specified text string.
-
MID
public static String MID(String text, Integer startPosition)
Returns the text from the middle of a text string.
-
PROPER
public static String PROPER(String text)
Capitalizes each words of the specified text. The remaining parts of words are in lowercase.
-
REPLACE
public static String REPLACE(String originalText, Integer startPosition, Integer charsNum, String newText)
Replaces parts of a text string with a different one. Starting from a specified position, removes a certain number of characters and then insert the new text.
-
REPT
public static String REPT(String originalText, Integer numberOfTimes)
Replicates an input text string for a specified number of times.
-
RIGHT
public static String RIGHT(String text)
Returns the specified number of characters (1 by default) from the right side of the input text.
-
SEARCH
public static Integer SEARCH(String findText, String textToSearch)
Returns the position of a string of text in another string. Search is not case-sensitive.
-
SUBSTITUTE
public static String SUBSTITUTE(String originalText, String oldText, String newText)
Substitutes new text for old text in a text string. When no occurrence is specified all occurrences are replaced.
-
SUBSTITUTE
public static String SUBSTITUTE(String originalText, String oldText, String newText, Integer occurrenceNum)
-
T
public static String T(Object value)
Returns the text string if the value is a string, otherwise an empty string is returned.
-
TEXT
public String TEXT(Number number, String numberFormat)
Converts a number into a text string according to a specified format.
-
TRIM
public static String TRIM(String text)
Clear a string,removing leading and trailing whitespaces.
-
-