public interface ObjectHandler
Modifier and Type | Method and Description |
---|---|
Object |
coerce(Object object)
Coerce results to Java native iterables, functions, callables.
|
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.
|
Writer |
falsey(Iteration iteration,
Writer writer,
Object object,
List<Object> scopes)
Call Iteration.next() either 0 (true) or 1 (fale) times.
|
Wrapper |
find(String name,
List<Object> scopes)
Find a value named "name" in the array of scopes in reverse order.
|
Writer |
iterate(Iteration iteration,
Writer writer,
Object object,
List<Object> scopes)
Iterate over an object by calling Iteration.next for each value.
|
static List<Object> |
makeList(Object scope) |
String |
stringify(Object object)
Turns an object into the string representation that should be displayed
in templates.
|
Wrapper find(String name, List<Object> scopes)
name
- the variable namescopes
- the ordered list of scopesObject coerce(Object object)
object
- transform an unknown type to a known typeWriter iterate(Iteration iteration, Writer writer, Object object, List<Object> scopes)
iteration
- callback for the next iterationwriter
- the writer to write toobject
- the current objectscopes
- the scopes presentWriter falsey(Iteration iteration, Writer writer, Object object, List<Object> scopes)
iteration
- callback for the next iterationwriter
- the writer to write toobject
- the current objectscopes
- the scopes presentBinding createBinding(String name, TemplateContext tc, Code code)
name
- the name that we boundtc
- the textual context of the binding sitecode
- the code that was boundString stringify(Object object)
object
- the object to be displayedCopyright © 2018. All rights reserved.