public class ReflectionObjectHandler extends BaseObjectHandler
| Modifier and Type | Field and Description |
|---|---|
private static Guard[] |
EMPTY_GUARDS |
private static Wrapper[] |
EMPTY_WRAPPERS |
protected static java.lang.reflect.Method |
MAP_METHOD |
| Constructor and Description |
|---|
ReflectionObjectHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
areMethodsAccessible(java.util.Map<?,?> map) |
Binding |
createBinding(java.lang.String name,
TemplateContext tc,
Code code)
Each call site has its own binding to allow for fine grained caching without
a separate parallel hierarchy of objects.
|
protected ClassGuard |
createClassGuard(int i,
java.lang.Object scope) |
protected DepthGuard |
createDepthGuard(int length) |
protected DotGuard |
createDotGuard(int i,
java.lang.Object scope,
java.lang.String lookup) |
protected MapGuard |
createMapGuard(int scopeIndex,
Wrapper[] wrappers,
java.lang.String name,
boolean contains) |
protected MissingWrapper |
createMissingWrapper(java.lang.String name,
java.util.List<Guard> guards) |
protected NullGuard |
createNullGuard() |
protected WrappedGuard |
createWrappedGuard(int i,
java.util.List<Wrapper> wrappers,
java.util.List<Guard> wrapperGuard) |
protected Wrapper |
createWrapper(int scopeIndex,
Wrapper[] wrappers,
java.util.List<? extends Guard> guard,
java.lang.reflect.AccessibleObject member,
java.lang.Object[] arguments) |
Wrapper |
find(java.lang.String name,
java.util.List<java.lang.Object> scopes)
Find a value named "name" in the array of scopes in reverse order.
|
protected Wrapper |
findWrapper(int scopeIndex,
Wrapper[] wrappers,
java.util.List<Guard> guards,
java.lang.Object scope,
java.lang.String name)
Find a wrapper given the current context.
|
static java.lang.Object |
unwrap(ObjectHandler oh,
int scopeIndex,
Wrapper[] wrappers,
java.util.List<java.lang.Object> scopes) |
checkField, checkMethod, coerce, falsey, findMember, getField, getMethod, iterate, stringifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmakeListprivate static final Wrapper[] EMPTY_WRAPPERS
private static final Guard[] EMPTY_GUARDS
protected static final java.lang.reflect.Method MAP_METHOD
public static java.lang.Object unwrap(ObjectHandler oh, int scopeIndex, Wrapper[] wrappers, java.util.List<java.lang.Object> scopes) throws GuardException
GuardExceptionpublic Wrapper find(java.lang.String name, java.util.List<java.lang.Object> scopes)
ObjectHandlername - the variable namescopes - the ordered list of scopesprotected Wrapper findWrapper(int scopeIndex, Wrapper[] wrappers, java.util.List<Guard> guards, java.lang.Object scope, java.lang.String name)
scopeIndex - the index into the scope arraywrappers - the current set of wrappers to get hereguards - the list of guards used to find thisscope - the current scopename - the name in the scopeprotected MissingWrapper createMissingWrapper(java.lang.String name, java.util.List<Guard> guards)
protected DotGuard createDotGuard(int i, java.lang.Object scope, java.lang.String lookup)
protected WrappedGuard createWrappedGuard(int i, java.util.List<Wrapper> wrappers, java.util.List<Guard> wrapperGuard)
protected NullGuard createNullGuard()
protected DepthGuard createDepthGuard(int length)
protected ClassGuard createClassGuard(int i, java.lang.Object scope)
protected MapGuard createMapGuard(int scopeIndex, Wrapper[] wrappers, java.lang.String name, boolean contains)
protected Wrapper createWrapper(int scopeIndex, Wrapper[] wrappers, java.util.List<? extends Guard> guard, java.lang.reflect.AccessibleObject member, java.lang.Object[] arguments)
public Binding createBinding(java.lang.String name, TemplateContext tc, Code code)
ObjectHandlercreateBinding in interface ObjectHandlercreateBinding in class BaseObjectHandlername - the name that we boundtc - the textual context of the binding sitecode - the code that was boundprotected boolean areMethodsAccessible(java.util.Map<?,?> map)