public class JavaExtensions extends Object
Constructor and Description |
---|
JavaExtensions() |
Modifier and Type | Method and Description |
---|---|
static String[] |
add(String[] array,
String o) |
static String |
addSlashes(Object o) |
static BaseTemplate.RawData |
asAttr(Map attributes) |
static BaseTemplate.RawData |
asAttr(Map attributes,
Object condition) |
static String |
asdate(Long timestamp) |
static String |
asdate(Long timestamp,
String pattern) |
static String |
asdate(Long timestamp,
String pattern,
String lang) |
static String |
asdate(Long timestamp,
String pattern,
String lang,
String timezone) |
static groovy.util.slurpersupport.GPathResult |
asXml(String xml) |
static String |
camelCase(String string) |
static String |
capAll(Object o) |
static String |
capFirst(Object o) |
static String |
capitalizeWords(String source) |
static boolean |
contains(String[] array,
String value) |
static String |
cut(Object o,
String pattern) |
static boolean |
divisibleBy(Number n,
int by) |
static Object[] |
enumValues(Class clazz) |
static BaseTemplate.RawData |
escape(Object o) |
static BaseTemplate.RawData |
escapeHtml(String htmlToEscape) |
static String |
escapeJavaScript(String str) |
static String |
escapeXml(String str) |
protected static boolean |
eval(Object condition) |
static String |
format(Date date) |
static String |
format(Date date,
String pattern) |
static String |
format(Date date,
String pattern,
String lang) |
static String |
format(Date date,
String pattern,
String lang,
String timezone) |
static String |
format(Number number,
String pattern) |
static String |
formatCurrency(Number number,
Locale locale) |
static String |
formatCurrency(Number number,
String currencyCode) |
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 representation
|
static Object |
last(List<?> items)
return the last item of a list or null if the List is null
|
static BaseTemplate.RawData |
nl2br(BaseTemplate.RawData data) |
static BaseTemplate.RawData |
nl2br(Object data) |
static String |
noAccents(String string) |
static String |
pad(String str,
Integer size) |
static Integer |
page(Number number,
Integer pageSize) |
static String |
pluralize(Collection n) |
static String |
pluralize(Collection n,
String plural) |
static String |
pluralize(Collection n,
String[] forms) |
static String |
pluralize(Number n) |
static String |
pluralize(Number n,
String plural) |
static String |
pluralize(Number n,
String[] forms) |
static BaseTemplate.RawData |
raw(Object val) |
static BaseTemplate.RawData |
raw(Object val,
Object condition) |
static String[] |
remove(String[] array,
String s) |
static String |
since(Date date) |
static String |
since(Date date,
Boolean stopAtMonth) |
static String |
slugify(String string) |
static String |
slugify(String string,
Boolean lowercase) |
static String |
toString(groovy.lang.Closure closure) |
static String |
urlEncode(String entity) |
static String |
yesno(Object o,
String[] values) |
public static groovy.util.slurpersupport.GPathResult asXml(String xml)
public static String toString(groovy.lang.Closure closure)
public static BaseTemplate.RawData escapeHtml(String htmlToEscape)
public static BaseTemplate.RawData raw(Object val)
public static BaseTemplate.RawData raw(Object val, Object condition)
public static BaseTemplate.RawData asAttr(Map attributes, Object condition)
public static BaseTemplate.RawData asAttr(Map attributes)
protected static boolean eval(Object condition)
public static BaseTemplate.RawData nl2br(BaseTemplate.RawData data)
public static BaseTemplate.RawData nl2br(Object data)
public static boolean divisibleBy(Number n, int by)
public static BaseTemplate.RawData escape(Object o)
public static String pluralize(Collection n)
public static String pluralize(Collection n, String plural)
public static String pluralize(Collection n, String[] forms)
public static Object last(List<?> items)
public static String join(Collection items, String separator)
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly