public class BasicRendererFactory extends Object implements RendererFactory, TilesContainerAware, TilesRequestContextFactoryAware, TilesApplicationContextAware, AttributeEvaluatorFactoryAware
Modifier and Type | Field and Description |
---|---|
protected TilesApplicationContext |
applicationContext
The Tiles application context.
|
protected AttributeEvaluatorFactory |
attributeEvaluatorFactory
The attribute evaluator.
|
protected TilesContainer |
container
The Tiles container.
|
protected TilesRequestContextFactory |
contextFactory
The Tiles context factory.
|
static String |
DEFAULT_RENDERER_CLASS_NAME
Deprecated.
Do not use, the default renderer class should be determined
when building the container.
|
static String |
DEFAULT_RENDERER_INIT_PARAM
The default renderer init parameter.
|
protected static Map<String,String> |
DEFAULT_TYPE_2_RENDERER
The default renderer name/renderer class map.
|
protected AttributeRenderer |
defaultRenderer
The default renderer.
|
protected Map<String,AttributeRenderer> |
renderers
The renderer name/renderer map.
|
static String |
TYPE_RENDERERS_INIT_PARAM
The type renderers init parameter name.
|
Constructor and Description |
---|
BasicRendererFactory()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
AttributeRenderer |
getRenderer(String name)
Returns a renderer by its name.
|
void |
init(Map<String,String> parameters)
Initialize the renderer factory.
|
protected void |
initializeRenderer(AttributeRenderer renderer)
Initialize a renderer, by injecting dependencies.
|
void |
registerRenderer(String name,
AttributeRenderer renderer)
Registers a renderer.
|
void |
setApplicationContext(TilesApplicationContext applicationContext)
Sets the Tiles application context.
|
void |
setAttributeEvaluatorFactory(AttributeEvaluatorFactory attributeEvaluatorFactory)
Sets the attribute evaluator factory.
|
void |
setContainer(TilesContainer container)
Sets the Tiles container.
|
void |
setDefaultRenderer(AttributeRenderer renderer)
Sets the default renderer.
|
void |
setRequestContextFactory(TilesRequestContextFactory contextFactory)
Sets the Tiles request context factory.
|
public static final String TYPE_RENDERERS_INIT_PARAM
public static final String DEFAULT_RENDERER_INIT_PARAM
public static final String DEFAULT_RENDERER_CLASS_NAME
protected static final Map<String,String> DEFAULT_TYPE_2_RENDERER
protected TilesRequestContextFactory contextFactory
protected TilesApplicationContext applicationContext
protected TilesContainer container
protected AttributeEvaluatorFactory attributeEvaluatorFactory
protected Map<String,AttributeRenderer> renderers
protected AttributeRenderer defaultRenderer
public void init(Map<String,String> parameters)
init
in interface RendererFactory
parameters
- The parameters for the initialization.public AttributeRenderer getRenderer(String name)
getRenderer
in interface RendererFactory
name
- The name of the renderer.public void setDefaultRenderer(AttributeRenderer renderer)
renderer
- The default renderer.public void registerRenderer(String name, AttributeRenderer renderer)
name
- The name of the renderer.renderer
- The renderer to register.public void setContainer(TilesContainer container)
setContainer
in interface TilesContainerAware
container
- The Tiles container.public void setAttributeEvaluatorFactory(AttributeEvaluatorFactory attributeEvaluatorFactory)
setAttributeEvaluatorFactory
in interface AttributeEvaluatorFactoryAware
attributeEvaluatorFactory
- The attribute evaluator factory to use.public void setRequestContextFactory(TilesRequestContextFactory contextFactory)
setRequestContextFactory
in interface TilesRequestContextFactoryAware
contextFactory
- The Tiles context factory.public void setApplicationContext(TilesApplicationContext applicationContext)
setApplicationContext
in interface TilesApplicationContextAware
applicationContext
- The Tiles application context.protected void initializeRenderer(AttributeRenderer renderer)
renderer
- The renderer to initialize.Copyright © 2016. All rights reserved.