public abstract class AbstractObjectHandler extends Object implements ObjectHandler
Constructor and Description |
---|
AbstractObjectHandler() |
Modifier and Type | Method and Description |
---|---|
Object |
coerce(Object object)
Coerce results to Java native iterables, functions, callables.
|
Writer |
falsey(Iteration iteration,
Writer writer,
Object object,
List<Object> scopes)
Call Iteration.next() either 0 (true) or 1 (fale) times.
|
Writer |
iterate(Iteration iteration,
Writer writer,
Object object,
List<Object> scopes)
Iterate over an object by calling Iteration.next for each value.
|
String |
stringify(Object object)
Turns an object into the string representation that should be displayed
in templates.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createBinding, find, makeList
protected static final Object NOT_FOUND
public Object coerce(Object object)
ObjectHandler
coerce
in interface ObjectHandler
object
- transform an unknown type to a known typepublic Writer falsey(Iteration iteration, Writer writer, Object object, List<Object> scopes)
ObjectHandler
falsey
in interface ObjectHandler
iteration
- callback for the next iterationwriter
- the writer to write toobject
- the current objectscopes
- the scopes presentpublic Writer iterate(Iteration iteration, Writer writer, Object object, List<Object> scopes)
ObjectHandler
iterate
in interface ObjectHandler
iteration
- callback for the next iterationwriter
- the writer to write toobject
- the current objectscopes
- the scopes presentpublic String stringify(Object object)
ObjectHandler
stringify
in interface ObjectHandler
object
- the object to be displayedCopyright © 2023. All rights reserved.