public abstract class BaseObjectHandler extends java.lang.Object implements ObjectHandler
| Constructor and Description |
|---|
BaseObjectHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkField(java.lang.reflect.Field member) |
protected void |
checkMethod(java.lang.reflect.Method member) |
java.lang.Object |
coerce(java.lang.Object object)
Coerce results to Java native iterables, functions, callables.
|
abstract Binding |
createBinding(java.lang.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.
|
java.io.Writer |
falsey(Iteration iteration,
java.io.Writer writer,
java.lang.Object object,
java.util.List<java.lang.Object> scopes)
Call Iteration.next() either 0 (true) or 1 (fale) times.
|
protected java.lang.reflect.AccessibleObject |
findMember(java.lang.Class sClass,
java.lang.String name) |
protected java.lang.reflect.Field |
getField(java.lang.Class aClass,
java.lang.String name) |
protected java.lang.reflect.Method |
getMethod(java.lang.Class<?> aClass,
java.lang.String name,
java.lang.Class<?>... params) |
java.io.Writer |
iterate(Iteration iteration,
java.io.Writer writer,
java.lang.Object object,
java.util.List<java.lang.Object> scopes)
Iterate over an object by calling Iteration.next for each value.
|
java.lang.String |
stringify(java.lang.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 java.lang.Object coerce(java.lang.Object object)
ObjectHandlercoerce in interface ObjectHandlerobject - transform an unknown type to a known typepublic java.io.Writer falsey(Iteration iteration, java.io.Writer writer, java.lang.Object object, java.util.List<java.lang.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(java.lang.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 java.io.Writer iterate(Iteration iteration, java.io.Writer writer, java.lang.Object object, java.util.List<java.lang.Object> scopes)
ObjectHandleriterate in interface ObjectHandleriteration - callback for the next iterationwriter - the writer to write toobject - the current objectscopes - the scopes presentprotected java.lang.reflect.Field getField(java.lang.Class aClass,
java.lang.String name)
throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldExceptionprotected java.lang.reflect.Method getMethod(java.lang.Class<?> aClass,
java.lang.String name,
java.lang.Class<?>... params)
throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodExceptionprotected java.lang.reflect.AccessibleObject findMember(java.lang.Class sClass,
java.lang.String name)
protected void checkMethod(java.lang.reflect.Method member)
throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodExceptionprotected void checkField(java.lang.reflect.Field member)
throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldExceptionpublic java.lang.String stringify(java.lang.Object object)
ObjectHandlerstringify in interface ObjectHandlerobject - the object to be displayed