Top Fields Constructors Methods
org.stringtemplate.v4.misc

public Class ObjectModelAdaptor<T>

extends Object
implements ModelAdaptor<T>
Class Inheritance
All Implemented Interfaces
org.stringtemplate.v4.ModelAdaptor
Imports
org.stringtemplate.v4.Interpreter, .ModelAdaptor, .ST, java.lang.reflect.Field, .Member, .Method, java.util.HashMap, .Map

Field Summary

Modifier and TypeField and Description
protected static final Member
protected static final Map<Class<?>, Map<String, Member>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected static Member
findMember(Class<?> clazz, String memberName)

public synchronized Object
getProperty(Interpreter interp, ST self, T model, Object property, String propertyName)

Implements org.stringtemplate.v4.ModelAdaptor.getProperty.

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)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INVALID_MEMBERback to summary
protected static final Member INVALID_MEMBER
membersCacheback to summary
protected static final Map<Class<?>, Map<String, Member>> membersCache

Constructor Detail

ObjectModelAdaptorback to summary
public ObjectModelAdaptor()

Method Detail

findMemberback to summary
protected static Member findMember(Class<?> clazz, String memberName)
getPropertyback to summary
public synchronized Object getProperty(Interpreter interp, ST self, T model, Object property, String propertyName) throws STNoSuchPropertyException

Implements org.stringtemplate.v4.ModelAdaptor.getProperty.

Doc from org.stringtemplate.v4.ModelAdaptor.getProperty.

Lookup property name in 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.

Annotations
@Override
throwNoSuchPropertyback to summary
protected Object throwNoSuchProperty(Class<?> clazz, String propertyName, Exception cause)
tryGetFieldback to summary
protected static Field tryGetField(Class<?> clazz, String fieldName)
tryGetMethodback to summary
protected static Method tryGetMethod(Class<?> clazz, String methodName)