play.templates
Class JavaExtensions
java.lang.Object
play.templates.JavaExtensions
public class JavaExtensions
- extends java.lang.Object
Java extensions in templates
Method Summary |
static java.lang.String[] |
add(java.lang.String[] array,
java.lang.String o)
|
static java.lang.String |
addSlashes(java.lang.Object o)
|
static java.lang.String |
asdate(java.lang.Long timestamp,
java.lang.String pattern)
|
static java.lang.String |
camelCase(java.lang.String string)
|
static java.lang.String |
capAll(java.lang.Object o)
|
static java.lang.String |
capFirst(java.lang.Object o)
|
static java.lang.String |
capitalizeWords(java.lang.String source)
|
static boolean |
contains(java.lang.String[] array,
java.lang.String value)
|
static java.lang.String |
cut(java.lang.Object o,
java.lang.String pattern)
|
static boolean |
divisibleBy(java.lang.Number n,
int by)
|
static java.lang.String |
escape(java.lang.Object o)
|
static java.lang.String |
escapeHtml(java.lang.String htmlToEscape)
|
static java.lang.String |
escapeJavaScript(java.lang.String str)
|
static java.lang.String |
escapeXml(java.lang.String str)
|
static java.lang.String |
format(java.util.Date date,
java.lang.String pattern)
|
static java.lang.String |
format(java.lang.Number number,
java.lang.String pattern)
|
static java.lang.String |
formatCurrency(java.lang.Number number,
java.lang.String currencyCode)
|
static java.lang.String |
formatSize(java.lang.Long bytes)
|
static java.lang.String |
join(java.util.Collection items,
java.lang.String separator)
concatenate items of a collection as a string separated with separator
items toString() method should be implemented to provide a string representation |
static java.lang.Object |
last(java.util.List items)
return the last item of a list or null if the List is null |
static java.lang.String |
nl2br(java.lang.String data)
|
static java.lang.String |
noAccents(java.lang.String string)
|
static java.lang.String |
pad(java.lang.String str,
java.lang.Integer size)
|
static java.lang.Integer |
page(java.lang.Number number,
java.lang.Integer pageSize)
|
static java.lang.String |
pluralize(java.util.Collection n)
|
static java.lang.String |
pluralize(java.util.Collection n,
java.lang.String plural)
|
static java.lang.String |
pluralize(java.util.Collection n,
java.lang.String[] forms)
|
static java.lang.String |
pluralize(java.lang.Number n)
|
static java.lang.String |
pluralize(java.lang.Number n,
java.lang.String plural)
|
static java.lang.String |
pluralize(java.lang.Number n,
java.lang.String[] forms)
|
static java.lang.String[] |
remove(java.lang.String[] array,
java.lang.String s)
|
static java.lang.String |
since(java.util.Date date)
|
static java.lang.String |
slugify(java.lang.String string)
|
static java.lang.String |
toString(groovy.lang.Closure closure)
|
static java.lang.String |
yesno(java.lang.Object o,
java.lang.String[] values)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaExtensions
public JavaExtensions()
contains
public static boolean contains(java.lang.String[] array,
java.lang.String value)
add
public static java.lang.String[] add(java.lang.String[] array,
java.lang.String o)
remove
public static java.lang.String[] remove(java.lang.String[] array,
java.lang.String s)
toString
public static java.lang.String toString(groovy.lang.Closure closure)
capitalizeWords
public static java.lang.String capitalizeWords(java.lang.String source)
pad
public static java.lang.String pad(java.lang.String str,
java.lang.Integer size)
escapeHtml
public static java.lang.String escapeHtml(java.lang.String htmlToEscape)
escapeJavaScript
public static java.lang.String escapeJavaScript(java.lang.String str)
escapeXml
public static java.lang.String escapeXml(java.lang.String str)
format
public static java.lang.String format(java.lang.Number number,
java.lang.String pattern)
format
public static java.lang.String format(java.util.Date date,
java.lang.String pattern)
page
public static java.lang.Integer page(java.lang.Number number,
java.lang.Integer pageSize)
since
public static java.lang.String since(java.util.Date date)
asdate
public static java.lang.String asdate(java.lang.Long timestamp,
java.lang.String pattern)
nl2br
public static java.lang.String nl2br(java.lang.String data)
formatSize
public static java.lang.String formatSize(java.lang.Long bytes)
formatCurrency
public static java.lang.String formatCurrency(java.lang.Number number,
java.lang.String currencyCode)
addSlashes
public static java.lang.String addSlashes(java.lang.Object o)
capFirst
public static java.lang.String capFirst(java.lang.Object o)
capAll
public static java.lang.String capAll(java.lang.Object o)
cut
public static java.lang.String cut(java.lang.Object o,
java.lang.String pattern)
divisibleBy
public static boolean divisibleBy(java.lang.Number n,
int by)
escape
public static java.lang.String escape(java.lang.Object o)
pluralize
public static java.lang.String pluralize(java.lang.Number n)
pluralize
public static java.lang.String pluralize(java.util.Collection n)
pluralize
public static java.lang.String pluralize(java.lang.Number n,
java.lang.String plural)
pluralize
public static java.lang.String pluralize(java.util.Collection n,
java.lang.String plural)
pluralize
public static java.lang.String pluralize(java.lang.Number n,
java.lang.String[] forms)
pluralize
public static java.lang.String pluralize(java.util.Collection n,
java.lang.String[] forms)
noAccents
public static java.lang.String noAccents(java.lang.String string)
slugify
public static java.lang.String slugify(java.lang.String string)
camelCase
public static java.lang.String camelCase(java.lang.String string)
yesno
public static java.lang.String yesno(java.lang.Object o,
java.lang.String[] values)
last
public static java.lang.Object last(java.util.List items)
- return the last item of a list or null if the List is null
join
public static java.lang.String join(java.util.Collection items,
java.lang.String separator)
- concatenate items of a collection as a string separated with separator
items toString() method should be implemented to provide a string representation
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly