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

org.apache.tiles.factory
Class BasicTilesContainerFactory

Package class diagram package BasicTilesContainerFactory
java.lang.Object
  extended by org.apache.tiles.factory.AbstractTilesContainerFactory
      extended by org.apache.tiles.factory.BasicTilesContainerFactory

public class BasicTilesContainerFactory
extends AbstractTilesContainerFactory

Factory that builds a standard Tiles container using only Java code.

Since:
2.1.0
Version:
$Rev: 819649 $ $Date: 2009-09-28 19:11:21 +0200 (lun, 28 set 2009) $

Field Summary
 
Fields inherited from class org.apache.tiles.factory.AbstractTilesContainerFactory
CONTAINER_FACTORY_INIT_PARAM
 
Constructor Summary
BasicTilesContainerFactory()
           
 
Method Summary
 TilesContainer createContainer(TilesApplicationContext applicationContext)
          Creates a Tiles container.
protected  AttributeRenderer createDefaultAttributeRenderer(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, TilesContainer container, AttributeEvaluator evaluator)
          Creates the default attribute renderer.
protected  DefinitionsFactory createDefinitionsFactory(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, LocaleResolver resolver)
          Creates the definitions factory.
protected  DefinitionsReader createDefinitionsReader(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory)
          Creates the definitions reader.
protected  AttributeEvaluator createEvaluator(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, LocaleResolver resolver)
          Creates the attribute evaluator to use.
protected  DefinitionDAO<Locale> createLocaleDefinitionDao(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, LocaleResolver resolver)
          Creates a Locale-based definition DAO.
protected  LocaleResolver createLocaleResolver(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory)
          Creates the locale resolver.
protected  PreparerFactory createPreparerFactory(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory)
          Creates the preparer factory to use.
protected  RendererFactory createRendererFactory(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, TilesContainer container, AttributeEvaluator evaluator)
          Creates a renderer factory.
protected  TilesRequestContextFactory createRequestContextFactory(TilesApplicationContext context)
          Create a Tiles request context factory.
protected  List<URL> getSourceURLs(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory)
          Returns a list containing the URLs to be parsed.
protected  BasicTilesContainer instantiateContainer(TilesApplicationContext context)
          Instantiate the container, without initialization.
protected  LocaleDefinitionsFactory instantiateDefinitionsFactory(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, LocaleResolver resolver)
          Instantiate a new definitions factory based on Locale.
protected  BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, LocaleResolver resolver)
          Instantiate (and does not initialize) a Locale-based definition DAO.
protected  void registerAttributeRenderers(BasicRendererFactory rendererFactory, TilesApplicationContext applicationContext, TilesRequestContextFactory contextFactory, TilesContainer container, AttributeEvaluator evaluator)
          Registers attribute renderers in a BasicRendererFactory.
protected  void registerChainedRequestContextFactories(ChainedTilesRequestContextFactory contextFactory)
          Register elements of a chained request context factory.
protected  void registerRequestContextFactory(String className, List<TilesRequestContextFactory> factories, TilesRequestContextFactory parent)
          Registers a TilesRequestContextFactory specifying its classname.
 
Methods inherited from class org.apache.tiles.factory.AbstractTilesContainerFactory
getTilesContainerFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTilesContainerFactory

public BasicTilesContainerFactory()
Method Detail

createContainer

public TilesContainer createContainer(TilesApplicationContext applicationContext)
Creates a Tiles container.

Specified by:
createContainer in class AbstractTilesContainerFactory
Parameters:
applicationContext - The Tiles application context object.
Returns:
The created container.

instantiateContainer

protected BasicTilesContainer instantiateContainer(TilesApplicationContext context)
Instantiate the container, without initialization.

Parameters:
context - The Tiles application context object.
Returns:
The instantiated container.
Since:
2.1.1

createRequestContextFactory

protected TilesRequestContextFactory createRequestContextFactory(TilesApplicationContext context)
Create a Tiles request context factory. By default it creates a ChainedTilesRequestContextFactory.

Parameters:
context - The Tiles application context.
Returns:
The request context factory.
Since:
2.1.1

registerChainedRequestContextFactories

protected void registerChainedRequestContextFactories(ChainedTilesRequestContextFactory contextFactory)
Register elements of a chained request context factory.

Parameters:
contextFactory - The request context factory to use.
Since:
2.1.1

registerRequestContextFactory

protected void registerRequestContextFactory(String className,
                                             List<TilesRequestContextFactory> factories,
                                             TilesRequestContextFactory parent)
Registers a TilesRequestContextFactory specifying its classname.

Parameters:
className - The name of the class to instantiate.
factories - The list of factories to add to.
parent - The parent TilesRequestContextFactory. If null it won't be considered.
Since:
2.1.1

createDefinitionsFactory

protected DefinitionsFactory createDefinitionsFactory(TilesApplicationContext applicationContext,
                                                      TilesRequestContextFactory contextFactory,
                                                      LocaleResolver resolver)
Creates the definitions factory. By default it creates a UrlDefinitionsFactory with default dependencies.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
resolver - The locale resolver.
Returns:
The definitions factory.
Since:
2.1.1

instantiateDefinitionsFactory

protected LocaleDefinitionsFactory instantiateDefinitionsFactory(TilesApplicationContext applicationContext,
                                                                 TilesRequestContextFactory contextFactory,
                                                                 LocaleResolver resolver)
Instantiate a new definitions factory based on Locale.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
resolver - The locale resolver.
Returns:
The definitions factory.
Since:
2.1.1

instantiateLocaleDefinitionDao

protected BaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(TilesApplicationContext applicationContext,
                                                                    TilesRequestContextFactory contextFactory,
                                                                    LocaleResolver resolver)
Instantiate (and does not initialize) a Locale-based definition DAO.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
resolver - The locale resolver.
Returns:
The definition DAO.
Since:
2.1.1

createLocaleDefinitionDao

protected DefinitionDAO<Locale> createLocaleDefinitionDao(TilesApplicationContext applicationContext,
                                                          TilesRequestContextFactory contextFactory,
                                                          LocaleResolver resolver)
Creates a Locale-based definition DAO.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
resolver - The locale resolver.
Returns:
The definition DAO.
Since:
2.1.1

createLocaleResolver

protected LocaleResolver createLocaleResolver(TilesApplicationContext applicationContext,
                                              TilesRequestContextFactory contextFactory)
Creates the locale resolver. By default it creates a DefaultLocaleResolver.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
Returns:
The locale resolver.
Since:
2.1.1

createDefinitionsReader

protected DefinitionsReader createDefinitionsReader(TilesApplicationContext applicationContext,
                                                    TilesRequestContextFactory contextFactory)
Creates the definitions reader. By default it creates a DigesterDefinitionsReader.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
Returns:
The definitions reader.
Since:
2.1.1

getSourceURLs

protected List<URL> getSourceURLs(TilesApplicationContext applicationContext,
                                  TilesRequestContextFactory contextFactory)
Returns a list containing the URLs to be parsed. By default, it returns a list containing the URL point to "/WEB-INF/tiles.xml".

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
Returns:
The source URLs.
Since:
2.1.1

createEvaluator

protected AttributeEvaluator createEvaluator(TilesApplicationContext applicationContext,
                                             TilesRequestContextFactory contextFactory,
                                             LocaleResolver resolver)
Creates the attribute evaluator to use. By default it returns a DirectAttributeEvaluator.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
resolver - The locale resolver.
Returns:
The evaluator.

createPreparerFactory

protected PreparerFactory createPreparerFactory(TilesApplicationContext applicationContext,
                                                TilesRequestContextFactory contextFactory)
Creates the preparer factory to use. By default it returns a BasicPreparerFactory.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
Returns:
The preparer factory.
Since:
2.1.1

createRendererFactory

protected RendererFactory createRendererFactory(TilesApplicationContext applicationContext,
                                                TilesRequestContextFactory contextFactory,
                                                TilesContainer container,
                                                AttributeEvaluator evaluator)
Creates a renderer factory. By default it returns a BasicRendererFactory, composed of an UntypedAttributeRenderer as default, and StringAttributeRenderer, TemplateAttributeRenderer and DefinitionAttributeRenderer.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
container - The container.
evaluator - The evaluator.
Returns:
The renderer factory.
Since:
2.1.1

createDefaultAttributeRenderer

protected AttributeRenderer createDefaultAttributeRenderer(TilesApplicationContext applicationContext,
                                                           TilesRequestContextFactory contextFactory,
                                                           TilesContainer container,
                                                           AttributeEvaluator evaluator)
Creates the default attribute renderer. By default it is an UntypedAttributeRenderer.

Parameters:
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
container - The container.
evaluator - The evaluator.
Returns:
The default attribute renderer.
Since:
2.1.1

registerAttributeRenderers

protected void registerAttributeRenderers(BasicRendererFactory rendererFactory,
                                          TilesApplicationContext applicationContext,
                                          TilesRequestContextFactory contextFactory,
                                          TilesContainer container,
                                          AttributeEvaluator evaluator)
Registers attribute renderers in a BasicRendererFactory. By default, it registers a StringAttributeRenderer, a TemplateAttributeRenderer and a DefinitionAttributeRenderer.

Parameters:
rendererFactory - The renderer factory to configure.
applicationContext - The Tiles application context.
contextFactory - The Tiles context factory.
container - The container.
evaluator - The evaluator.
Since:
2.1.1


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