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