Tag reference sheet

Tag library reference for the following tag libraries:

dateutils - version 1.0

Date-related EL functions

Namespace definition: xmlns:du="dateutils"

EL Functions

  • currentDateIncluded() Tests if the current date is between the specified time interval (limits included)
  • formatDate() Format a date based on a given pattern, or a builtin style (short, medium, long or full)
  • formatDateTime() Format a date and time based on a given pattern, or a builtin style (short, medium, long or full)
  • formatDateTimeWithLocale() Format a date and time with a specified language (lowercase two-letter ISO-639 code) based on a given pattern, or a builtin style (short, medium, long or full)
  • formatInterval() format a milliseconds interval as a string like 523h 22m 18s
  • formatTime() Format a time based on a given pattern, or a builtin style (short, medium, long or full)
  • getMillisFromNow() retrieve the milliseconds in difference between now and the input date
  • parseDate() parse a date with a given pattern and return the parsed date as a calendar object (null safe)
  • parseXsdDate() parse a date in XSD format and return the parsed date as a calendar object (null safe)
  • toXsdDate() format a date in XSD format (null safe)

Required attributes are marked with a*

du:currentDateIncluded(java.util.Calendar, java.util.Calendar)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: boolean currentDateIncluded(java.util.Calendar, java.util.Calendar)

Tests if the current date is between the specified time interval (limits included)

du:formatDate(java.util.Calendar, java.lang.String, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.lang.String formatDate(java.util.Calendar, java.lang.String, java.lang.String)

Format a date based on a given pattern, or a builtin style (short, medium, long or full)

du:formatDateTime(java.util.Calendar, java.lang.String, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.lang.String formatDateTime(java.util.Calendar, java.lang.String, java.lang.String)

Format a date and time based on a given pattern, or a builtin style (short, medium, long or full). Also supports different styles for date and time with the syntax "date_style;time_style" (e.g. "short;long")

du:formatDateTimeWithLocale(java.util.Calendar, java.lang.String, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.lang.String formatDateTimeWithLocale(java.util.Calendar, java.lang.String, java.lang.String)

Format a date and time with a specified language (lowercase two-letter ISO-639 code) based on a given pattern, or a builtin style (short, medium, long or full). Also supports different styles for date and time with the syntax "date_style;time_style" (e.g. "short;long")

du:formatInterval(java.lang.Long)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.lang.String formatInterval(java.lang.Long)

format a milliseconds interval as a string like 523h 22m 18s

du:formatTime(java.util.Calendar, java.lang.String, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.lang.String formatTime(java.util.Calendar, java.lang.String, java.lang.String)

Format a time based on a given pattern, or a builtin style (short, medium, long or full)

du:getMillisFromNow(java.util.Calendar)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.lang.Long getMillisFromNow(java.util.Calendar)

retrieve the milliseconds in difference between now and the input date

du:parseDate(java.lang.String, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.util.Calendar parseDate(java.lang.String, java.lang.String)

parse a date with a given pattern and return the parsed date as a calendar object (null safe)

du:parseXsdDate(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.util.Calendar parseXsdDate(java.lang.String)

parse a date in XSD format and return the parsed date as a calendar object (null safe)

du:toXsdDate(java.util.Calendar)

Function class: net.sourceforge.openutils.elfunctions.DateElUtils

Function signature: java.lang.String toXsdDate(java.util.Calendar)

format a date in XSD format (null safe)

stringutils - version 1.0

Openutils EL functions: stringutils

Namespace definition: xmlns:su="http://openutils.sf.net/openutils-stringutils"

EL Functions

  • adaptStringLength() Crops a String to a given length, adding a suffix (for example "
  • capitaliseAllWords() Capitalizes all the whitespace separated words in a String
  • defaultIfEmpty() Returns either the passed in String, or if the String is empty or null, the value of defaultStr
  • endsWith() A wrapper around java
  • escJsTxt() Escapes a javascript string
  • isBlank() Checks if a String is whitespace, empty ("") or null
  • newline() Output a newline character
  • randomAlphanumeric() Creates a random string whose length is the number of characters specified
  • randomInt() Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), from the Math
  • shorten() Shorten a text with a number of lines and a number of chars per line to be displayed
  • space() Output a white space
  • splitNewlines() Splits the given strings on newlines
  • splitOnTabs() Splits the given string on tab characters
  • strip() Strips whitespaces from the start and the end of a String
  • stripHtmlTags() Strip any html tag from a String
  • substringAfterLast() Gets the substring after the last occurrence of a separator
  • substringBeforeLast() Gets the substring before the last occurrence of a separator
  • tab() Output a tab character
  • toCeilLong() Parse a double, passed as String, and return his ceil as a long (or 0L if parse fails)
  • toFloorLong() Parse a double, passed as String, and return his floor as a long (or 0L if parse fails)
  • toLong() Parse a number, passed as String, and return his Long
  • toRoundedLong() Parse a number, passed as String, and return his closest rounding as a long (or 0L if parse fails)
  • unescapeXml() Unescapes a String
  • urldecode() Decode a url in UTF-8 format
  • urlencode() Enconde a url in UTF-8 format

Required attributes are marked with a*

su:adaptStringLength(java.lang.String, int, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String adaptStringLength(java.lang.String, int, java.lang.String)

Crops a String to a given length, adding a suffix (for example "...") if needed. The function takes 3 parameters: <br/><strong>java.lang.String:</strong> the string to be adapted<br/> <strong>int:</strong> the number of chars of the string to be kept<br/> <strong>java.lang.String:</strong> the suffix to be added if the string is not complete

Example

      
        adaptStringLength("pre",2,"post") :  prpost
      
    

su:capitaliseAllWords(java.lang.String)

Function class: org.apache.commons.lang.StringUtils

Function signature: java.lang.String capitaliseAllWords(java.lang.String)

Capitalizes all the whitespace separated words in a String. Only the first letter of each word is changed.

su:defaultIfEmpty(java.lang.String, java.lang.String)

Function class: org.apache.commons.lang.StringUtils

Function signature: java.lang.String defaultIfEmpty(java.lang.String, java.lang.String)

Returns either the passed in String, or if the String is empty or null, the value of defaultStr. The function takes 2 parameters: <br/> <strong>java.lang.String: </strong>the String to check, may be null<br/> <strong>java.lang.String: </strong>the default String to return if the string to check is null of empty<br/>

su:endsWith(java.lang.String, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: boolean endsWith(java.lang.String, java.lang.String)

A wrapper around java.lang.String#endsWith(..). Tests if this string ends with the specified suffix. The function takes 2 parameters: <br/> <strong>java.lang.String: </strong>string to evaluate<br/> <strong>java.lang.String: </strong>suffix<br/>

su:escJsTxt(java.lang.String, boolean)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String escapeJsText(java.lang.String, boolean)

Escapes a javascript string. If "true" is passed as parameter, the string is between ", if false is bewteen '

Example

      
        escJsTxt("xyz\\23",true) : "xyz\23"
      
    

su:isBlank(java.lang.String )

Function class: org.apache.commons.lang.StringUtils

Function signature: boolean isBlank(java.lang.String )

Checks if a String is whitespace, empty ("") or null.

su:newline()

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String newline()

Output a newline character.

su:randomAlphanumeric(int)

Function class: org.apache.commons.lang.RandomStringUtils

Function signature: java.lang.String randomAlphanumeric(int)

Creates a random string whose length is the number of characters specified.

su:randomInt(int)

Function class: org.apache.commons.lang.math.RandomUtils

Function signature: int nextInt(int)

Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), from the Math.random() sequence.

su:shorten(java.lang.String, int, int, java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String shorten(java.lang.String, int, int, java.lang.String)

Shorten a text with a number of lines and a number of chars per line to be displayed. Display ellipses the line is shortened. The function takes 4 parameters: <br/> <strong>java.lang.String: </strong>original text<br/> <strong>int: </strong>number of lines<br/> <strong>int: </strong>number of chars per line <strong>java.lang.String: </strong>optional ellipses ('...') to display optional ellipses where the line is shortened.

su:space()

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String space()

Output a white space.

su:splitNewlines(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String[] splitNewlines(java.lang.String)

Splits the given strings on newlines

su:splitOnTabs(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String[] splitOnTabs(java.lang.String)

Splits the given string on tab characters

su:strip(java.lang.String)

Function class: org.apache.commons.lang.StringUtils

Function signature: java.lang.String strip(java.lang.String)

Strips whitespaces from the start and the end of a String

su:stripHtmlTags(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String stripHtmlTags(java.lang.String)

Strip any html tag from a String.

su:substringAfterLast(java.lang.String, java.lang.String)

Function class: org.apache.commons.lang.StringUtils

Function signature: java.lang.String substringAfterLast(java.lang.String, java.lang.String)

Gets the substring after the last occurrence of a separator. The separator is not returned. The function takes 2 parameters: <br/> <strong>java.lang.String: </strong>the String to get a substring from, may be null<br/> <strong>java.lang.String: </strong>the String to search for, may be null<br/>

su:substringBeforeLast(java.lang.String, java.lang.String)

Function class: org.apache.commons.lang.StringUtils

Function signature: java.lang.String substringBeforeLast(java.lang.String, java.lang.String)

Gets the substring before the last occurrence of a separator. The separator is not returned. The function takes 2 parameters: <br/> <strong>java.lang.String: </strong>the String to get a substring from, may be null<br/> <strong>java.lang.String: </strong>the String to search for, may be null<br/>

su:tab()

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String tab()

Output a tab character.

su:toCeilLong(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.Long toCeilLong(java.lang.String)

Parse a double, passed as String, and return his ceil as a long (or 0L if parse fails)

su:toFloorLong(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.Long toFloorLong(java.lang.String)

Parse a double, passed as String, and return his floor as a long (or 0L if parse fails)

su:toLong(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.Long toLong(java.lang.String)

Parse a number, passed as String, and return his Long

su:toRoundedLong(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.Long toRoundedLong(java.lang.String)

Parse a number, passed as String, and return his closest rounding as a long (or 0L if parse fails)

su:unescapeXml(java.lang.String)

Function class: org.apache.commons.lang.StringEscapeUtils

Function signature: java.lang.String unescapeXml(java.lang.String)

Unescapes a String

su:urldecode(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String urldecode(java.lang.String)

Decode a url in UTF-8 format

su:urlencode(java.lang.String)

Function class: net.sourceforge.openutils.elfunctions.ElStringUtils

Function signature: java.lang.String urlencode(java.lang.String)

Enconde a url in UTF-8 format

collectionutils - version 1.0

Collection-related EL functions

Namespace definition: xmlns:cu="collectionutils"

EL Functions

Required attributes are marked with a*

cu:entryset(java.util.Map)

Function class: net.sourceforge.openutils.elfunctions.CollectionElUtils

Function signature: java.util.Map$Entry entryset(java.util.Map)

Retuns the set of Map.Entry from a Map (can be used to iterate on the map)

cu:paginateCollection(java.util.Collection, int)

Function class: net.sourceforge.openutils.elfunctions.CollectionElUtils

Function signature: java.util.List paginateCollection(java.util.Collection, int)

Splits a collection into pages of the specified size

cu:shuffle(java.util.List)

Function class: net.sourceforge.openutils.elfunctions.CollectionElUtils

Function signature: java.util.List shuffle(java.util.List)

Randomly permutes the specified list

cu:toList(java.lang.Object[])

Function class: net.sourceforge.openutils.elfunctions.CollectionElUtils

Function signature: java.util.List toList(java.lang.Object[])

Converts an array to a list