Package com.github.mustachejava.reflect
Class GuardedBinding
java.lang.Object
com.github.mustachejava.reflect.GuardedBinding
- All Implemented Interfaces:
Binding
Codes are bound to their variables through bindings.
User: sam
Date: 7/7/12
Time: 6:05 PM
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Codeprivate static booleanprivate static final Wrapper[]private static Loggerprivate final Stringprivate final ObjectHandlerThe chances of a new guard every time is very low.private Wrapper[]private final TemplateContext -
Constructor Summary
ConstructorsConstructorDescriptionGuardedBinding(ObjectHandler oh, String name, TemplateContext tc, Code code) -
Method Summary
Modifier and TypeMethodDescriptionprivate ObjectcreateAndGet(List<Object> scopes) Retrieve the first value in the stacks of scopes that matches the give name.protected WrappergetWrapper(String name, List<Object> scopes) static voidlogWarning(String warning, String name, List<Object> scopes, TemplateContext tc)
-
Field Details
-
EMPTY_WRAPPERS
-
logger
-
debug
private static boolean debug -
oh
-
tc
-
name
-
code
-
previousSet
The chances of a new guard every time is very low. Instead we will store previously used guards and try them all before creating a new one. -
prevWrappers
-
-
Constructor Details
-
GuardedBinding
-
-
Method Details
-
get
Retrieve the first value in the stacks of scopes that matches the give name. The method wrappers are cached and guarded against the type or number of scopes changing. Methods will be found using the object handler, called here with another lookup on a guard failure and finally coerced to a final value based on the ObjectHandler you provide. -
createAndGet
-
getWrapper
-
logWarning
-