Class ObjectModelAdaptor<T>
java.lang.Object
org.stringtemplate.v4.misc.ObjectModelAdaptor<T>
- All Implemented Interfaces:
ModelAdaptor<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static MemberfindMember(Class<?> clazz, String memberName) getProperty(Interpreter interp, ST self, T model, Object property, String propertyName) Lookup property name inoand return its value.protected ObjectthrowNoSuchProperty(Class<?> clazz, String propertyName, Exception cause) protected static FieldtryGetField(Class<?> clazz, String fieldName) protected static MethodtryGetMethod(Class<?> clazz, String methodName)
-
Field Details
-
INVALID_MEMBER
-
membersCache
-
-
Constructor Details
-
ObjectModelAdaptor
public ObjectModelAdaptor()
-
-
Method Details
-
getProperty
public Object getProperty(Interpreter interp, ST self, T model, Object property, String propertyName) throws STNoSuchPropertyException Description copied from interface:ModelAdaptorLookup property name inoand return its value.propertyis normally aStringbut doesn't have to be. E.g., ifoisMap,propertycould be any key type. If we need to convert toString, then it's done bySTand passed in here.- Specified by:
getPropertyin interfaceModelAdaptor<T>- Throws:
STNoSuchPropertyException
-
findMember
-
tryGetMethod
-
tryGetField
-
throwNoSuchProperty
-