public abstract class BaseObjectHandler extends Object implements ObjectHandler
| Constructor and Description |
|---|
BaseObjectHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkClass(Class sClass) |
protected void |
checkField(Field member) |
protected void |
checkMethod(Method member) |
Object |
coerce(Object object)
Coerce results to Java native iterables, functions, callables.
|
abstract 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.
|
protected AccessibleObject |
findMember(Class sClass,
String name) |
protected Field |
getField(Class aClass,
String name) |
protected Method |
getMethod(Class<?> aClass,
String name,
Class<?>... params) |
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, waitfind, makeListpublic Object coerce(Object object)
ObjectHandlercoerce in interface ObjectHandlerobject - transform an unknown type to a known typepublic Writer falsey(Iteration iteration, Writer writer, Object object, List<Object> scopes)
ObjectHandlerfalsey in interface ObjectHandleriteration - callback for the next iterationwriter - the writer to write toobject - the current objectscopes - the scopes presentpublic abstract Binding createBinding(String name, TemplateContext tc, Code code)
ObjectHandlercreateBinding in interface ObjectHandlername - the name that we boundtc - the textual context of the binding sitecode - the code that was boundpublic Writer iterate(Iteration iteration, Writer writer, Object object, List<Object> scopes)
ObjectHandleriterate in interface ObjectHandleriteration - callback for the next iterationwriter - the writer to write toobject - the current objectscopes - the scopes presentprotected Field getField(Class aClass, String name) throws NoSuchFieldException
NoSuchFieldExceptionprotected Method getMethod(Class<?> aClass, String name, Class<?>... params) throws NoSuchMethodException
NoSuchMethodExceptionprotected AccessibleObject findMember(Class sClass, String name)
protected void checkMethod(Method member) throws NoSuchMethodException
NoSuchMethodExceptionprotected void checkField(Field member) throws NoSuchFieldException
NoSuchFieldExceptionprotected boolean checkClass(Class sClass)
public String stringify(Object object)
ObjectHandlerstringify in interface ObjectHandlerobject - the object to be displayedCopyright © 2021. All rights reserved.