Package org.stringtemplate.v4.misc
Class ObjectModelAdaptor<T>
- java.lang.Object
-
- org.stringtemplate.v4.misc.ObjectModelAdaptor<T>
-
- All Implemented Interfaces:
ModelAdaptor<T>
public class ObjectModelAdaptor<T> extends Object implements ModelAdaptor<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected static Member
INVALID_MEMBER
protected static Map<Class<?>,Map<String,Member>>
membersCache
-
Constructor Summary
Constructors Constructor Description ObjectModelAdaptor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static Member
findMember(Class<?> clazz, String memberName)
Object
getProperty(Interpreter interp, ST self, T model, Object property, String propertyName)
Lookup property name ino
and return its value.protected Object
throwNoSuchProperty(Class<?> clazz, String propertyName, Exception cause)
protected static Field
tryGetField(Class<?> clazz, String fieldName)
protected static Method
tryGetMethod(Class<?> clazz, String methodName)
-
-
-
Method Detail
-
getProperty
public Object getProperty(Interpreter interp, ST self, T model, Object property, String propertyName) throws STNoSuchPropertyException
Description copied from interface:ModelAdaptor
Lookup property name ino
and return its value.property
is normally aString
but doesn't have to be. E.g., ifo
isMap
,property
could be any key type. If we need to convert toString
, then it's done byST
and passed in here.- Specified by:
getProperty
in interfaceModelAdaptor<T>
- Throws:
STNoSuchPropertyException
-
-