public class BeanRendererImpl extends Object implements io.neba.api.rendering.BeanRenderer
class hierarchy and a provided viewHint to
build possible template names for the object. Supports adding additional elements to the
rendering context.
Example: For a class io.neba.MyModel implementing the interface
io.neba.MyInterface, the renderer will attempt to resolve the following
templates (in this particular order according to the
ClassHierarchyIterator), if the repositoryPath is "/apps/views/" and
the view hint is null:
The first view found is used to render the object.
Likewise, when rendering with a viewhint, e.g. "teaser", the following views would be resolved:
| Constructor and Description |
|---|
BeanRendererImpl(String repositoryPath,
org.apache.velocity.app.VelocityEngine engine,
List<org.apache.sling.scripting.api.BindingsValuesProvider> bindingsValuesProviders) |
| Modifier and Type | Method and Description |
|---|---|
String |
createTemplateName(String viewHint,
Class<?> type) |
String |
render(Object bean) |
String |
render(Object bean,
Map<String,Object> context) |
String |
render(Object bean,
String viewHint) |
String |
render(Object bean,
String viewHint,
Map<String,Object> additionalContextElements) |
String |
renderInternal(Object object,
String templatePath,
Map<String,Object> additionalContextElements) |
public String render(Object bean, String viewHint, Map<String,Object> additionalContextElements)
render in interface io.neba.api.rendering.BeanRendererpublic String renderInternal(Object object, String templatePath, Map<String,Object> additionalContextElements)
public String render(Object bean)
render in interface io.neba.api.rendering.BeanRendererpublic String render(Object bean, Map<String,Object> context)
render in interface io.neba.api.rendering.BeanRendererCopyright © 2014–2015. All rights reserved.