This project has retired. For details please refer to its Attic page.
BasicRendererFactory (Tiles 2 2.2.2 API)

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, TilesRequestContextFactoryAware, AttributeEvaluatorFactoryAware, RendererFactory

public class BasicRendererFactory
extends Object
implements RendererFactory, TilesContainerAware, TilesRequestContextFactoryAware, TilesApplicationContextAware, AttributeEvaluatorFactoryAware

Basic renderer factory implementation.

Since:
2.1.0
Version:
$Rev: 820373 $ $Date: 2009-09-30 20:26:58 +0200 (mer, 30 set 2009) $

Field Summary
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 Summary
BasicRendererFactory()
          Constructor.
 
Method Summary
 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.
 
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 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 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 String DEFAULT_RENDERER_CLASS_NAME
Deprecated. Do not use, the default renderer class should be determined when building the container.
The default renderer class name.

Since:
2.1.0

DEFAULT_TYPE_2_RENDERER

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

Since:
2.1.0

contextFactory

protected TilesRequestContextFactory contextFactory
The Tiles context factory.

Since:
2.1.1

applicationContext

protected TilesApplicationContext applicationContext
The Tiles application context.

Since:
2.1.0

container

protected TilesContainer container
The Tiles container.

Since:
2.1.0

attributeEvaluatorFactory

protected AttributeEvaluatorFactory attributeEvaluatorFactory
The attribute evaluator.

Since:
2.2.0

renderers

protected Map<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(Map<String,String> parameters)
Initialize the renderer factory.

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

getRenderer

public AttributeRenderer getRenderer(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(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.

setAttributeEvaluatorFactory

public void setAttributeEvaluatorFactory(AttributeEvaluatorFactory attributeEvaluatorFactory)
Sets the attribute evaluator factory.

Specified by:
setAttributeEvaluatorFactory in interface AttributeEvaluatorFactoryAware
Parameters:
attributeEvaluatorFactory - The attribute evaluator factory to use.

setRequestContextFactory

public void setRequestContextFactory(TilesRequestContextFactory contextFactory)
Sets the Tiles request context factory.

Specified by:
setRequestContextFactory in interface TilesRequestContextFactoryAware
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


Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.