|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.taggercat.el.ELInternalFunctions
public class ELInternalFunctions
This class represents the internal functions available to the EL.
| Constructor Summary | |
|---|---|
ELInternalFunctions()
|
|
| Method Summary | |
|---|---|
static java.lang.Object |
check(java.lang.Boolean condition,
java.lang.Object iffalse)
Returns true if the condition is true, otherwise, the
iffalse value is returned. |
static java.lang.Object |
choose(java.lang.Object... args)
Returns the result of the first corresponding true condition
This method is essentially a single line switch statement. |
static java.lang.Boolean |
contains(java.lang.String string,
java.lang.String find)
Returns the index within the string of the first
occurrence of the find argument. |
static java.lang.Object |
convert(java.lang.Number number,
java.lang.Integer typeId)
Converts the number argument to the specified type. |
static java.util.Date |
date()
Returns the current system date. |
static java.util.Date |
dateAdd(java.util.Date date,
java.lang.Integer delta)
Returns the delta number of days to the date. |
static java.util.Date |
dateAdd(java.util.Date date,
java.lang.Integer delta,
java.lang.Integer partId)
Adds the specified delta to the date where
the delta type is specified with the partId. |
static java.lang.Integer |
dateDiff(java.util.Date date1,
java.util.Date date2)
Returns the number of days between the date1 and
date2 values. |
static java.lang.Integer |
dateDiff(java.util.Date date1,
java.util.Date date2,
java.lang.Integer partId)
Returns the difference between the date1 and
date2 values. |
static java.lang.Integer |
datePart(java.util.Date date,
java.lang.Number partId)
Returns the date part for the date. |
static java.lang.Integer |
dayOfWeek(java.util.Date date)
Returns the Calendar.DAY_OF_WEEK for the date. |
static java.util.Date |
endOfDay()
Returns the end of the current day. |
static java.util.Date |
endOfDay(java.util.Date date)
Returns the end of the given date. |
static java.util.Date |
endOfDay(java.util.Date date,
java.util.Calendar cal)
Returns the end of the given date and calendar. |
static java.util.Date |
endOfHour(java.util.Date date)
Returns the the end of the hour of the current date ( and time ) |
static java.util.Date |
endOfHour(java.util.Date date,
java.util.Calendar cal)
Returns the the end of the hour of the current date ( and time ) and calendar |
static java.util.Date |
endOfMonth()
Returns the end of the month for the current system date |
static java.util.Date |
endOfMonth(java.util.Date date)
Returns the end of the month for the specified date |
static java.util.Date |
endOfMonth(java.util.Date date,
java.util.Calendar cal)
Returns the end of the month for the specified date and calendar |
static java.lang.Boolean |
endsWith(java.lang.String string,
java.lang.String suffix)
Returns true if the string ends with the specified
suffix. |
static java.util.Date |
getDate()
Returns the current system date. |
static java.lang.Object |
ifNull(java.lang.Object obj,
java.lang.String nullReplacement)
Returns the nullReplacement object if the first argument
is null, otherwise the first argument is returned. |
static java.lang.Object |
iif(java.lang.Boolean condition,
java.lang.Object trueResult,
java.lang.Object falseResult)
Returns the trueResult if the condition
expression is true, otherwise the falseResult. |
static java.lang.Integer |
indexOf(java.lang.String searchFor,
java.lang.String searchIn)
Returns the index within this string of the first occurrence of the specified substring. |
static java.lang.Boolean |
isEmpty(java.util.Collection collection)
Returns true if the collection is null or empty. |
static java.lang.Boolean |
isEmpty(java.util.Map map)
Returns true if the map is empty. |
static java.lang.Boolean |
isEmpty(java.lang.String string)
Returns true of the string argument is null or empty. |
static java.lang.String |
lower(java.lang.String string)
Converts the string to lower case. |
static java.lang.Double |
max(java.lang.Number a,
java.lang.Number b)
The max of the two Number values. |
static java.lang.Double |
min(java.lang.Number a,
java.lang.Number b)
The min of the two Number values. |
static java.util.Date |
noonOfDay(java.util.Date date,
java.util.Calendar cal)
|
static java.util.Date |
now()
Returns the current system date. |
static java.lang.String |
quote(java.lang.String string)
Wraps the string argument value in double quotes. |
static java.lang.String |
replaceAll(java.lang.String string,
java.lang.String regex,
java.lang.String replacement)
Replaces each substring of this string that matches the given regular expression with the given replacement. |
static java.lang.String |
replaceFirst(java.lang.String string,
java.lang.String regex,
java.lang.String replacement)
Replaces the first substring of this string that matches the given regular expression with the given replacement. |
static java.lang.String |
singleQuote(java.lang.String string)
Wraps the string argument in single quotes. |
static java.util.Date |
startOfDay()
Returns the start of the day for the current system date |
static java.util.Date |
startOfDay(java.util.Date date)
Returns the start of the day for the specified date |
static java.util.Date |
startOfDay(java.util.Date date,
java.util.Calendar cal)
Returns the start of the day for the specified date and calendar |
static java.util.Date |
startOfMonth()
Returns the start of the month for the current system date |
static java.util.Date |
startOfMonth(java.util.Date date)
Returns the start of the month for the specified date |
static java.util.Date |
startOfMonth(java.util.Date date,
java.util.Calendar cal)
Returns the start of the month for the specified date and calendar |
static java.lang.Boolean |
startsWith(java.lang.String string,
java.lang.String prefix)
Returns true if the string argument is prefixed with the
prefix value. |
static java.lang.String |
subString(java.lang.String string,
java.lang.Number beginIndex,
java.lang.Number endIndex)
Returns a new string that is a substring of this string. |
static java.util.Date |
toDate(java.lang.String dateString)
Parses the dateString to a date value. |
static java.util.Date |
toDate(java.lang.String dateString,
java.lang.String format)
Parses the dateString to a date value using the specified
format formatter. |
static java.lang.String |
trim(java.lang.String string)
Returns the string argument trimmed of white space
characters. |
static java.lang.String |
upper(java.lang.String string)
Returns the string argument converted to upper case. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ELInternalFunctions()
| Method Detail |
|---|
public static java.lang.Object check(java.lang.Boolean condition,
java.lang.Object iffalse)
condition is true, otherwise, the
iffalse value is returned. This function is equivalent to
IIF( condition, true, theFalseValue)
condition - the boolean condition to check.iffalse - the value to return if the condition is false
public static java.lang.Boolean contains(java.lang.String string,
java.lang.String find)
string of the first
occurrence of the find argument.
string - any string.find - the string to find.
public static java.lang.Object convert(java.lang.Number number,
java.lang.Integer typeId)
throws ParseException
number argument to the specified type.
number - the number to converttypeId - the type id to convert to, the supported types are defined
with the following constants:
number argument to the specified type
ParseExceptionpublic static java.util.Date date()
public static java.util.Date dateAdd(java.util.Date date,
java.lang.Integer delta)
delta number of days to the date.
date - the date to add the days todelta - the number of days to add to the date
date with the delta number of
days added to it
public static java.util.Date dateAdd(java.util.Date date,
java.lang.Integer delta,
java.lang.Integer partId)
delta to the date where
the delta type is specified with the partId.
date - the datedelta - the deltapartId - the date part, the supported date parts are defined with the
following constants:
public static java.lang.Integer dateDiff(java.util.Date date1,
java.util.Date date2)
date1 and
date2 values.
date1 - the first datedate2 - the second date
public static java.lang.Integer dateDiff(java.util.Date date1,
java.util.Date date2,
java.lang.Integer partId)
date1 and
date2 values.
date1 - the first datedate2 - the second datepartId - the date part, the supported date parts are defined with the
following constants:
public static java.lang.Integer datePart(java.util.Date date,
java.lang.Number partId)
date.
date - the datepartId - the date part, the supported date parts are defined with the
following constants:
public static java.lang.Integer dayOfWeek(java.util.Date date)
Calendar.DAY_OF_WEEK for the date.
date - the reference date
Calendar.DAY_OF_WEEK for the date
public static java.lang.Boolean endsWith(java.lang.String string,
java.lang.String suffix)
string ends with the specified
suffix.
string - suffix -
public static java.util.Date getDate()
public static java.lang.Object ifNull(java.lang.Object obj,
java.lang.String nullReplacement)
nullReplacement object if the first argument
is null, otherwise the first argument is returned.
obj - the object to check for nullnullReplacement - the value to return if null.
public static java.lang.Object choose(java.lang.Object... args)
result of the first corresponding true condition
This method is essentially a single line switch statement.
If a condition is true, then the following result expression is returned.
If none of the conditions evaluate to true, then the null is returned
args - a variable number of condition - result expressions
public static java.lang.Object iif(java.lang.Boolean condition,
java.lang.Object trueResult,
java.lang.Object falseResult)
trueResult if the condition
expression is true, otherwise the falseResult.
condition - the expression to testtrueResult - the true resultfalseResult - the false result
public static java.lang.Integer indexOf(java.lang.String searchFor,
java.lang.String searchIn)
searchFor - the string to search forsearchIn - tje string to search in
public static java.lang.Boolean isEmpty(java.util.Collection collection)
collection is null or empty.
collection - the collection to check
public static java.lang.Boolean isEmpty(java.util.Map map)
map is empty.
map - the map object to check
public static java.lang.Boolean isEmpty(java.lang.String string)
string argument is null or empty.
string - the string to check
public static java.lang.String lower(java.lang.String string)
string to lower case.
string - the string to convert
public static java.lang.Double max(java.lang.Number a,
java.lang.Number b)
a - one of the numbersb - the other number
public static java.lang.Double min(java.lang.Number a,
java.lang.Number b)
a - one of the numbersb - the other number
public static java.util.Date now()
public static java.lang.String quote(java.lang.String string)
string argument value in double quotes.
string - the string to wrap
public static java.lang.String singleQuote(java.lang.String string)
string argument in single quotes.
string - the arg to single quote
public static java.lang.Boolean startsWith(java.lang.String string,
java.lang.String prefix)
string argument is prefixed with the
prefix value.
string - the value to checkprefix - the prefix to check for
string argument is prefixed with the
prefix value
public static java.lang.String replaceAll(java.lang.String string,
java.lang.String regex,
java.lang.String replacement)
string - the string to replace the values inregex - the regular expression to which this string is to be matchedreplacement - the replacement string
public static java.lang.String replaceFirst(java.lang.String string,
java.lang.String regex,
java.lang.String replacement)
string - the string to replace the values inregex - the regular expression to which this string is to be matchedreplacement - the replacement string
public static java.lang.String subString(java.lang.String string,
java.lang.Number beginIndex,
java.lang.Number endIndex)
beginIndex and extends to the
character at index endIndex - 1.
string - beginIndex - endIndex -
public static java.util.Date toDate(java.lang.String dateString)
throws ParseException
dateString to a date value.
dateString - the string to parse
ParseException
public static java.util.Date toDate(java.lang.String dateString,
java.lang.String format)
throws ParseException
dateString to a date value using the specified
format formatter.
dateString - the date string to parseformat - the format to use
ParseExceptionpublic static java.lang.String trim(java.lang.String string)
string argument trimmed of white space
characters.
string -
string argument trimmed of white space
characterspublic static java.lang.String upper(java.lang.String string)
string argument converted to upper case.
string -
string argument converted to upper casepublic static java.util.Date endOfDay()
public static java.util.Date endOfDay(java.util.Date date)
date - the reference date
public static java.util.Date endOfDay(java.util.Date date,
java.util.Calendar cal)
date - the reference date
public static java.util.Date endOfHour(java.util.Date date)
date - the reference date
public static java.util.Date endOfHour(java.util.Date date,
java.util.Calendar cal)
date - the reference datecal - the reference calendar
public static java.util.Date startOfMonth()
public static java.util.Date startOfMonth(java.util.Date date)
date - the reference date
public static java.util.Date startOfMonth(java.util.Date date,
java.util.Calendar cal)
date - the reference datecal - the reference calendar
public static java.util.Date endOfMonth()
public static java.util.Date endOfMonth(java.util.Date date)
public static java.util.Date endOfMonth(java.util.Date date,
java.util.Calendar cal)
date - the reference datecal - the reference calendar
public static java.util.Date startOfDay()
public static java.util.Date startOfDay(java.util.Date date)
date - the reference date
public static java.util.Date startOfDay(java.util.Date date,
java.util.Calendar cal)
date - the reference datecal - the reference calendar
public static java.util.Date noonOfDay(java.util.Date date,
java.util.Calendar cal)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||