Package org.apache.velocity.util
Class DuckType
java.lang.Object
org.apache.velocity.util.DuckType
Support for getAs<java.lang.reflect.Type>() convention for rendering (String), evaluating (Boolean)
or doing math with (Number) references.
- Since:
- 2.0
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
static boolean
static Number
static Number
static String
static String
static void
Clears the internal cache of all the underlying Types.protected static Method
findMethod
(Class<?> c, DuckType.Types type) protected static Object
get
(Object value, DuckType.Types type) private static Method
-
Field Details
-
NO_METHOD
-
-
Constructor Details
-
DuckType
public DuckType()
-
-
Method Details
-
clearCache
public static void clearCache()Clears the internal cache of all the underlying Types. -
asString
-
asString
-
asNull
-
asBoolean
-
asEmpty
-
asNumber
-
asNumber
-
get
-
findMethod
-
getMethod
-