public abstract class BaseObjectHandler extends Object implements ObjectHandler
Constructor and Description |
---|
BaseObjectHandler() |
Modifier and Type | Method and Description |
---|---|
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,
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,
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
find
public Object coerce(Object object)
ObjectHandler
coerce
in interface ObjectHandler
public Writer falsey(Iteration iteration, Writer writer, Object object, Object[] scopes)
ObjectHandler
falsey
in interface ObjectHandler
public abstract Binding createBinding(String name, TemplateContext tc, Code code)
ObjectHandler
createBinding
in interface ObjectHandler
public Writer iterate(Iteration iteration, Writer writer, Object object, Object[] scopes)
ObjectHandler
iterate
in interface ObjectHandler
protected Field getField(Class aClass, String name) throws NoSuchFieldException
NoSuchFieldException
protected Method getMethod(Class aClass, String name, Class... params) throws NoSuchMethodException
NoSuchMethodException
protected AccessibleObject findMember(Class sClass, String name)
protected void checkMethod(Method member) throws NoSuchMethodException
NoSuchMethodException
protected void checkField(Field member) throws NoSuchFieldException
NoSuchFieldException
public String stringify(Object object)
ObjectHandler
stringify
in interface ObjectHandler
object
- the object to be displayedCopyright © 2014. All rights reserved.