Package com.github.jknack.handlebars
Class Handlebars.Utils
- java.lang.Object
-
- com.github.jknack.handlebars.Handlebars.Utils
-
- Enclosing class:
- Handlebars
public static class Handlebars.Utils extends Object
Utilities function like:escapeExpression(CharSequence)andisEmpty(Object).- Since:
- 0.1.0
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CharSequenceescapeExpression(CharSequence input)Escapes the characters in aStringusing HTML entities.static booleanisEmpty(Object value)Evaluate the given object and return true is the object is considered empty.
-
-
-
Method Detail
-
isEmpty
public static boolean isEmpty(Object value)
Evaluate the given object and return true is the object is considered empty. Nulls, empty list or array and false values are considered empty.- Parameters:
value- The object value.- Returns:
- Return true is the object is considered empty. Nulls, empty list or array and false values are considered empty.
-
escapeExpression
public static CharSequence escapeExpression(CharSequence input)
Escapes the characters in a
Stringusing HTML entities.For example:
becomes:"bread" & "butter""bread" & "butter"
- Parameters:
input- theStringto escape, may be null.- Returns:
- The escaped version of the input or the same input if it's a SafeString.
-
-