org.apache.tiles.renderer.impl
Class BasicRendererFactory

Package class diagram package BasicRendererFactory
java.lang.Object
  extended by org.apache.tiles.renderer.impl.BasicRendererFactory
All Implemented Interfaces:
TilesApplicationContextAware, TilesContainerAware, TilesContextFactoryAware, AttributeEvaluatorAware, RendererFactory

public class BasicRendererFactory
extends java.lang.Object
implements RendererFactory, TilesContainerAware, TilesContextFactoryAware, TilesApplicationContextAware, AttributeEvaluatorAware

Basic renderer factory implementation.

Since:
2.1.0

Field Summary
protected  TilesApplicationContext applicationContext
          The Tiles application context.
protected  TilesContainer container
          The Tiles container.
protected  TilesContextFactory contextFactory
          The Tiles context factory.
static java.lang.String DEFAULT_RENDERER_CLASS_NAME
          The default renderer class name.
static java.lang.String DEFAULT_RENDERER_INIT_PARAM
          The default renderer init parameter.
protected static java.util.Map<java.lang.String,java.lang.String> DEFAULT_TYPE_2_RENDERER
          The default renderer name/renderer class map.
protected  AttributeRenderer defaultRenderer
          The default renderer.
protected  AttributeEvaluator evaluator
          The attribute evaluator.
protected  java.util.Map<java.lang.String,AttributeRenderer> renderers
          The renderer name/renderer map.
static java.lang.String TYPE_RENDERERS_INIT_PARAM
          The type renderers init parameter name.
 
Constructor Summary
BasicRendererFactory()
          Constructor.
 
Method Summary
 AttributeRenderer getRenderer(java.lang.String name)
          Returns a renderer by its name.
 void init(java.util.Map<java.lang.String,java.lang.String> parameters)
          Initialize the renderer factory.
protected  void initializeRenderer(AttributeRenderer renderer)
          Initialize a renderer, by injecting dependencies.
 void registerRenderer(java.lang.String name, AttributeRenderer renderer)
          Registers a renderer.
 void setApplicationContext(TilesApplicationContext applicationContext)
          Sets the Tiles application context.
 void setContainer(TilesContainer container)
          Sets the Tiles container.
 void setContextFactory(TilesContextFactory contextFactory)
          Sets the Tiles context factory.
 void setDefaultRenderer(AttributeRenderer renderer)
          Sets the default renderer.
 void setEvaluator(AttributeEvaluator evaluator)
          Sets the evaluator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_RENDERERS_INIT_PARAM

public static final java.lang.String TYPE_RENDERERS_INIT_PARAM
The type renderers init parameter name.

Since:
2.1.0
See Also:
Constant Field Values

DEFAULT_RENDERER_INIT_PARAM

public static final java.lang.String DEFAULT_RENDERER_INIT_PARAM
The default renderer init parameter.

Since:
2.1.0
See Also:
Constant Field Values

DEFAULT_RENDERER_CLASS_NAME

public static final java.lang.String DEFAULT_RENDERER_CLASS_NAME
The default renderer class name.

Since:
2.1.0

DEFAULT_TYPE_2_RENDERER

protected static final java.util.Map<java.lang.String,java.lang.String> DEFAULT_TYPE_2_RENDERER
The default renderer name/renderer class map.

Since:
2.1.0

contextFactory

protected TilesContextFactory contextFactory
The Tiles context factory.

Since:
2.1.0

applicationContext

protected TilesApplicationContext applicationContext
The Tiles application context.

Since:
2.1.0

container

protected TilesContainer container
The Tiles container.

Since:
2.1.0

evaluator

protected AttributeEvaluator evaluator
The attribute evaluator.

Since:
2.1.0

renderers

protected java.util.Map<java.lang.String,AttributeRenderer> renderers
The renderer name/renderer map.

Since:
2.1.0

defaultRenderer

protected AttributeRenderer defaultRenderer
The default renderer.

Since:
2.1.0
Constructor Detail

BasicRendererFactory

public BasicRendererFactory()
Constructor.

Since:
2.1.0
Method Detail

init

public void init(java.util.Map<java.lang.String,java.lang.String> parameters)
Initialize the renderer factory.

Specified by:
init in interface RendererFactory
Parameters:
parameters - The parameters for the initialization.

getRenderer

public AttributeRenderer getRenderer(java.lang.String name)
Returns a renderer by its name.

Specified by:
getRenderer in interface RendererFactory
Parameters:
name - The name of the renderer.
Returns:
The renderer.

setDefaultRenderer

public void setDefaultRenderer(AttributeRenderer renderer)
Sets the default renderer.

Parameters:
renderer - The default renderer.
Since:
2.1.0

registerRenderer

public void registerRenderer(java.lang.String name,
                             AttributeRenderer renderer)
Registers a renderer.

Parameters:
name - The name of the renderer.
renderer - The renderer to register.
Since:
2.1.0

setContainer

public void setContainer(TilesContainer container)
Sets the Tiles container.

Specified by:
setContainer in interface TilesContainerAware
Parameters:
container - The Tiles container.

setEvaluator

public void setEvaluator(AttributeEvaluator evaluator)
Sets the evaluator.

Specified by:
setEvaluator in interface AttributeEvaluatorAware
Parameters:
evaluator - The evaluator to set.

setContextFactory

public void setContextFactory(TilesContextFactory contextFactory)
Sets the Tiles context factory.

Specified by:
setContextFactory in interface TilesContextFactoryAware
Parameters:
contextFactory - The Tiles context factory.

setApplicationContext

public void setApplicationContext(TilesApplicationContext applicationContext)
Sets the Tiles application context.

Specified by:
setApplicationContext in interface TilesApplicationContextAware
Parameters:
applicationContext - The Tiles application context.

initializeRenderer

protected void initializeRenderer(AttributeRenderer renderer)
Initialize a renderer, by injecting dependencies.

Parameters:
renderer - The renderer to initialize.
Since:
2.1.0