public class ReflectionObjectHandler extends BaseObjectHandler
Modifier and Type | Field and Description |
---|---|
protected static Method |
MAP_METHOD |
Constructor and Description |
---|
ReflectionObjectHandler() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
areMethodsAccessible(Map<?,?> map) |
Binding |
createBinding(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,
Object scope) |
protected DepthGuard |
createDepthGuard(int length) |
protected DotGuard |
createDotGuard(int i,
Object scope,
String lookup) |
protected MapGuard |
createMapGuard(int scopeIndex,
Wrapper[] wrappers,
String name,
boolean contains) |
protected MissingWrapper |
createMissingWrapper(String name,
List<Guard> guards) |
protected NullGuard |
createNullGuard() |
protected WrappedGuard |
createWrappedGuard(int i,
List<Wrapper> wrappers,
List<Guard> wrapperGuard) |
protected Wrapper |
createWrapper(int scopeIndex,
Wrapper[] wrappers,
List<? extends Guard> guard,
AccessibleObject member,
Object[] arguments) |
Wrapper |
find(String name,
List<Object> scopes)
Find a value named "name" in the array of scopes in reverse order.
|
protected Wrapper |
findWrapper(int scopeIndex,
Wrapper[] wrappers,
List<Guard> guards,
Object scope,
String name)
Find a wrapper given the current context.
|
static Object |
unwrap(ObjectHandler oh,
int scopeIndex,
Wrapper[] wrappers,
List<Object> scopes) |
checkField, checkMethod, coerce, falsey, findMember, getField, getMethod, iterate, stringify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
makeList
protected static final Method MAP_METHOD
public static Object unwrap(ObjectHandler oh, int scopeIndex, Wrapper[] wrappers, List<Object> scopes) throws GuardException
GuardException
public Wrapper find(String name, List<Object> scopes)
ObjectHandler
name
- the variable namescopes
- the ordered list of scopesprotected Wrapper findWrapper(int scopeIndex, Wrapper[] wrappers, List<Guard> guards, Object scope, 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(String name, List<Guard> guards)
protected WrappedGuard createWrappedGuard(int i, List<Wrapper> wrappers, List<Guard> wrapperGuard)
protected NullGuard createNullGuard()
protected DepthGuard createDepthGuard(int length)
protected ClassGuard createClassGuard(int i, Object scope)
protected MapGuard createMapGuard(int scopeIndex, Wrapper[] wrappers, String name, boolean contains)
protected Wrapper createWrapper(int scopeIndex, Wrapper[] wrappers, List<? extends Guard> guard, AccessibleObject member, Object[] arguments)
public Binding createBinding(String name, TemplateContext tc, Code code)
ObjectHandler
createBinding
in interface ObjectHandler
createBinding
in class BaseObjectHandler
name
- the name that we boundtc
- the textual context of the binding sitecode
- the code that was boundprotected boolean areMethodsAccessible(Map<?,?> map)
Copyright © 2018. All rights reserved.