public class ObjectModelAdaptor extends Object implements ModelAdaptor
Modifier and Type | Field and Description |
---|---|
protected static Member |
INVALID_MEMBER |
protected static Map<Class<?>,Map<String,Member>> |
membersCache |
Constructor and Description |
---|
ObjectModelAdaptor() |
Modifier and Type | Method and Description |
---|---|
protected static Member |
findMember(Class<?> clazz,
String memberName) |
Object |
getProperty(Interpreter interp,
ST self,
Object o,
Object property,
String propertyName)
Lookup property name in
o 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) |
protected static final Member INVALID_MEMBER
public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException
ModelAdaptor
o
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 ModelAdaptor
STNoSuchPropertyException
Copyright © 2024. All rights reserved.