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
- Author:
- Nathan Bubna
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanstatic booleanstatic Numberstatic Numberstatic Stringstatic Stringstatic voidClears the internal cache of all the underlying Types.protected static MethodfindMethod(Class<?> c, DuckType.Types type) protected static Objectget(Object value, DuckType.Types type)
-
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
-