public class ObjectModelAdaptor extends java.lang.Object implements ModelAdaptor
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.reflect.Member |
INVALID_MEMBER |
protected static java.util.Map<java.lang.Class<?>,java.util.Map<java.lang.String,java.lang.reflect.Member>> |
membersCache |
| Constructor and Description |
|---|
ObjectModelAdaptor() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.lang.reflect.Member |
findMember(java.lang.Class<?> clazz,
java.lang.String memberName) |
java.lang.Object |
getProperty(Interpreter interp,
ST self,
java.lang.Object o,
java.lang.Object property,
java.lang.String propertyName)
Lookup property name in
o and return its value. |
protected java.lang.Object |
throwNoSuchProperty(java.lang.Class<?> clazz,
java.lang.String propertyName,
java.lang.Exception cause) |
protected static java.lang.reflect.Field |
tryGetField(java.lang.Class<?> clazz,
java.lang.String fieldName) |
protected static java.lang.reflect.Method |
tryGetMethod(java.lang.Class<?> clazz,
java.lang.String methodName) |
protected static final java.lang.reflect.Member INVALID_MEMBER
protected static final java.util.Map<java.lang.Class<?>,java.util.Map<java.lang.String,java.lang.reflect.Member>> membersCache
public java.lang.Object getProperty(Interpreter interp, ST self, java.lang.Object o, java.lang.Object property, java.lang.String propertyName) throws STNoSuchPropertyException
ModelAdaptoro and return its value.
property is normally a String but doesn't have to be.
E.g., if o is Map, property could be
any key type. If we need to convert to String, then it's done by
ST and passed in here.
getProperty in interface ModelAdaptorSTNoSuchPropertyExceptionprotected static java.lang.reflect.Member findMember(java.lang.Class<?> clazz,
java.lang.String memberName)
protected static java.lang.reflect.Method tryGetMethod(java.lang.Class<?> clazz,
java.lang.String methodName)
protected static java.lang.reflect.Field tryGetField(java.lang.Class<?> clazz,
java.lang.String fieldName)
protected java.lang.Object throwNoSuchProperty(java.lang.Class<?> clazz,
java.lang.String propertyName,
java.lang.Exception cause)
Copyright © 2019. All Rights Reserved.