Package play.templates
Class JavaExtensions
java.lang.Object
play.templates.JavaExtensions
Java extensions in templates
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
static String
addSlashes
(Object o) static play.templates.BaseTemplate.RawData
static play.templates.BaseTemplate.RawData
static String
static String
static String
static String
static groovy.util.slurpersupport.GPathResult
static String
static String
static String
static String
capitalizeWords
(String source) static boolean
static String
static boolean
divisibleBy
(Number n, int by) static Object[]
enumValues
(Class clazz) static play.templates.BaseTemplate.RawData
static play.templates.BaseTemplate.RawData
escapeHtml
(String htmlToEscape) static String
escapeJavaScript
(String str) static String
protected static boolean
static String
static String
static String
static String
static String
static String
formatCurrency
(Number number, String currencyCode) static String
formatCurrency
(Number number, Locale locale) static String
formatSize
(long bytes) static String
join
(Collection items, String separator) Concatenate items of a collection as a string separated with separator items toString() method should be implemented to provide a string representationstatic Object
return the last item of a list or null if the List is nullstatic play.templates.BaseTemplate.RawData
static play.templates.BaseTemplate.RawData
nl2br
(play.templates.BaseTemplate.RawData data) static String
static String
static Integer
static String
static String
static String
static String
static String
pluralize
(Collection n, String plural) static String
pluralize
(Collection n, String[] forms) static play.templates.BaseTemplate.RawData
static play.templates.BaseTemplate.RawData
static String[]
static String
static String
static String
static String
static String
toString
(groovy.lang.Closure closure) static String
static String
-
Constructor Details
-
JavaExtensions
public JavaExtensions()
-
-
Method Details
-
enumValues
-
contains
-
asXml
-
add
-
remove
-
toString
-
capitalizeWords
-
pad
-
escapeHtml
-
escapeJavaScript
-
raw
-
raw
-
asAttr
-
asAttr
-
eval
-
escapeXml
-
format
-
format
-
format
-
format
-
format
-
page
-
since
-
since
-
asdate
-
asdate
-
asdate
-
asdate
-
nl2br
public static play.templates.BaseTemplate.RawData nl2br(play.templates.BaseTemplate.RawData data) -
nl2br
-
urlEncode
-
formatSize
-
formatCurrency
-
formatCurrency
-
addSlashes
-
capFirst
-
capAll
-
cut
-
divisibleBy
-
escape
-
pluralize
-
pluralize
-
pluralize
-
pluralize
-
pluralize
-
pluralize
-
noAccents
-
slugify
-
slugify
-
camelCase
-
yesno
-
last
return the last item of a list or null if the List is null- Parameters:
items
- List of items- Returns:
- the last item of a list or null if the List is null
-
join
Concatenate items of a collection as a string separated with separator items toString() method should be implemented to provide a string representation- Parameters:
items
- List of itemsseparator
- The separator to used- Returns:
- The concatenate items of a collection as a string
-