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

org.apache.tiles.impl
Class KeyedDefinitionsFactoryTilesContainer

Package class diagram package KeyedDefinitionsFactoryTilesContainer
java.lang.Object
  extended by org.apache.tiles.impl.BasicTilesContainer
      extended by org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer
All Implemented Interfaces:
TilesContainer
Direct Known Subclasses:
CachingKeyedDefinitionsFactoryTilesContainer

public class KeyedDefinitionsFactoryTilesContainer
extends BasicTilesContainer

Container that can be used to store multiple DefinitionsFactory instances mapped to different keys.

Version:
$Rev: 642355 $ $Date: 2008-03-28 21:02:36 +0100 (ven, 28 mar 2008) $

Nested Class Summary
static class KeyedDefinitionsFactoryTilesContainer.DefaultKeyExtractor
          This is the default factory key.
static interface KeyedDefinitionsFactoryTilesContainer.KeyExtractor
          It represents an object able to return a key from a request.
 
Field Summary
static String DEFINITIONS_CONFIG_PREFIX
          Constant representing the prefix of the configuration parameter used to define the tiles definition resources for a specific key.
protected  Map<String,DefinitionsFactory> key2definitionsFactory
          Maps definition factories to their keys.
protected  KeyedDefinitionsFactoryTilesContainer.KeyExtractor keyExtractor
          The key extractor object.
 
Fields inherited from class org.apache.tiles.impl.BasicTilesContainer
DEFINITIONS_CONFIG
 
Constructor Summary
KeyedDefinitionsFactoryTilesContainer()
          Constructor.
 
Method Summary
protected  Definition getDefinition(String definitionName, TilesRequestContext request)
          Returns a definition specifying its name.
 DefinitionsFactory getDefinitionsFactory(String key)
          Returns a definition factory given its key.
protected  String getDefinitionsFactoryKey(TilesRequestContext request)
          Returns the definitions factory key.
 DefinitionsFactory getProperDefinitionsFactory(String key)
          Returns the proper definition factory for the given key, i.e. if the key is not present, null will be returned.
 void setDefinitionsFactory(String key, DefinitionsFactory definitionsFactory)
          Set the definitions factory.
 void setDefinitionsFactory(String key, DefinitionsFactory definitionsFactory, Map<String,String> initParameters)
          Deprecated. Use setDefinitionsFactory(String, DefinitionsFactory).
 void setKeyExtractor(KeyedDefinitionsFactoryTilesContainer.KeyExtractor keyExtractor)
          Sets the key extractor to use.
 
Methods inherited from class org.apache.tiles.impl.BasicTilesContainer
checkInit, endContext, evaluate, getApplicationContext, getAttributeContext, getContext, getContextFactory, getContextStack, getDefinitionsFactory, getPreparerFactory, getRequestContextFactory, getResourceNames, getResourceString, getResourceString, init, initializeDefinitionsFactory, isValidDefinition, popContext, prepare, pushContext, render, render, render, render, render, render, renderContext, setApplicationContext, setContextFactory, setDefinitionsFactory, setEvaluator, setPreparerFactory, setRendererFactory, setRequestContextFactory, startContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFINITIONS_CONFIG_PREFIX

public static final String DEFINITIONS_CONFIG_PREFIX
Constant representing the prefix of the configuration parameter used to define the tiles definition resources for a specific key.

See Also:
Constant Field Values

key2definitionsFactory

protected Map<String,DefinitionsFactory> key2definitionsFactory
Maps definition factories to their keys.


keyExtractor

protected KeyedDefinitionsFactoryTilesContainer.KeyExtractor keyExtractor
The key extractor object.

Constructor Detail

KeyedDefinitionsFactoryTilesContainer

public KeyedDefinitionsFactoryTilesContainer()
Constructor.

Method Detail

getDefinitionsFactory

public DefinitionsFactory getDefinitionsFactory(String key)
Returns a definition factory given its key.

Parameters:
key - The key of the needed definitions factory.
Returns:
the definitions factory used by this container. If the key is not valid, the default factory will be returned.

getProperDefinitionsFactory

public DefinitionsFactory getProperDefinitionsFactory(String key)
Returns the proper definition factory for the given key, i.e. if the key is not present, null will be returned.

Parameters:
key - The key of the needed definitions factory.
Returns:
the definitions factory used by this container. If the key is not valid, null will be returned.

setDefinitionsFactory

@Deprecated
public void setDefinitionsFactory(String key,
                                             DefinitionsFactory definitionsFactory,
                                             Map<String,String> initParameters)
Deprecated. Use setDefinitionsFactory(String, DefinitionsFactory).

Set the definitions factory. This method first ensures that the container has not yet been initialized.

Parameters:
key - The key under which the definitions factory is catalogued.
definitionsFactory - the definitions factory for this instance.
initParameters - The init parameters to configure the definitions factory.

setDefinitionsFactory

public void setDefinitionsFactory(String key,
                                  DefinitionsFactory definitionsFactory)
Set the definitions factory. This method first ensures that the container has not yet been initialized.

Parameters:
key - The key under which the definitions factory is catalogued.
definitionsFactory - the definitions factory for this instance.
Since:
2.1.0

setKeyExtractor

public void setKeyExtractor(KeyedDefinitionsFactoryTilesContainer.KeyExtractor keyExtractor)
Sets the key extractor to use.

Parameters:
keyExtractor - The key extractor.

getDefinition

protected Definition getDefinition(String definitionName,
                                   TilesRequestContext request)
Returns a definition specifying its name.

Overrides:
getDefinition in class BasicTilesContainer
Parameters:
definitionName - The name of the definition to find.
request - The request context.
Returns:
The definition, if found.

getDefinitionsFactoryKey

protected String getDefinitionsFactoryKey(TilesRequestContext request)
Returns the definitions factory key.

Parameters:
request - The request object.
Returns:
The needed factory key.


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