|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.apache.tiles.impl.BasicTilesContainer
public class BasicTilesContainer
Basic implementation of the tiles container interface. In most cases, this container will be customized by injecting customized services, not necessarily by override the container
| Field Summary | |
|---|---|
static String |
DEFINITIONS_CONFIG
Constant representing the configuration parameter used to define the tiles definition resources. |
| Constructor Summary | |
|---|---|
BasicTilesContainer()
|
|
| Method Summary | |
|---|---|
protected void |
checkInit()
Determine whether or not the container has been initialized. |
void |
endContext(Object... requestItems)
|
TilesApplicationContext |
getApplicationContext()
Returns the Tiles application context used by this container. |
AttributeContext |
getAttributeContext(Object... requestItems)
|
protected AttributeContext |
getContext(TilesRequestContext tilesContext)
Get attribute context from request. |
TilesContextFactory |
getContextFactory()
Returns the context factory. |
protected Stack<AttributeContext> |
getContextStack(TilesRequestContext tilesContext)
Returns the context stack. |
protected Definition |
getDefinition(String definitionName,
TilesRequestContext request)
Returns a definition specifying its name. |
DefinitionsFactory |
getDefinitionsFactory()
Returns the definitions factory. |
PreparerFactory |
getPreparerFactory()
Returns the preparer factory used by this container. |
protected List<String> |
getResourceNames(String resourceString)
Parse the resourceString into a list of resource paths which can be loaded by the application context. |
protected String |
getResourceString()
Derive the resource string from the initialization parameters. |
protected String |
getResourceString(Map<String,String> parms)
Derive the resource string from the initialization parameters. |
void |
init(Map<String,String> initParameters)
Initialize the Container with the given configuration. |
protected void |
initializeDefinitionsFactory(DefinitionsFactory definitionsFactory,
String resourceString,
Map<String,String> initParameters)
Initializes a definitions factory. |
boolean |
isValidDefinition(String definitionName,
Object... requestItems)
|
protected AttributeContext |
popContext(TilesRequestContext tilesContext)
Pops a context object out of the stack. |
void |
prepare(String preparer,
Object... requestItems)
|
protected void |
pushContext(AttributeContext context,
TilesRequestContext tilesContext)
Pushes a context object in the stack. |
void |
render(Attribute attr,
Writer writer,
Object... requestItems)
|
void |
render(String definitionName,
Object... requestItems)
|
void |
setApplicationContext(TilesApplicationContext context)
Sets the Tiles application context to use. |
void |
setContextFactory(TilesContextFactory contextFactory)
Sets the context factory. |
void |
setDefinitionsFactory(DefinitionsFactory definitionsFactory)
Set the definitions factory. |
void |
setPreparerFactory(PreparerFactory preparerFactory)
Set the preparerInstance factory. |
AttributeContext |
startContext(Object... requestItems)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFINITIONS_CONFIG
| Constructor Detail |
|---|
public BasicTilesContainer()
| Method Detail |
|---|
public void init(Map<String,String> initParameters)
throws TilesException
init in interface TilesContainerinitParameters - application context for this container
TilesException - If something goes wrong during initialization.public AttributeContext startContext(Object... requestItems)
startContext in interface TilesContainerpublic void endContext(Object... requestItems)
endContext in interface TilesContainerpublic TilesApplicationContext getApplicationContext()
getApplicationContext in interface TilesContainerpublic void setApplicationContext(TilesApplicationContext context)
context - The Tiles application context.public AttributeContext getAttributeContext(Object... requestItems)
getAttributeContext in interface TilesContainerpublic TilesContextFactory getContextFactory()
public void setContextFactory(TilesContextFactory contextFactory)
contextFactory - The context factory.public DefinitionsFactory getDefinitionsFactory()
public void setDefinitionsFactory(DefinitionsFactory definitionsFactory)
definitionsFactory - the definitions factory for this instance.public PreparerFactory getPreparerFactory()
public void setPreparerFactory(PreparerFactory preparerFactory)
preparerFactory - the preparerInstance factory for this conainer.
public void prepare(String preparer,
Object... requestItems)
throws TilesException
prepare in interface TilesContainerTilesException
public void render(String definitionName,
Object... requestItems)
throws TilesException
render in interface TilesContainerTilesException
public void render(Attribute attr,
Writer writer,
Object... requestItems)
throws TilesException,
IOException
render in interface TilesContainerTilesException
IOException
public boolean isValidDefinition(String definitionName,
Object... requestItems)
isValidDefinition in interface TilesContainer
protected Definition getDefinition(String definitionName,
TilesRequestContext request)
throws DefinitionsFactoryException
definitionName - The name of the definition to find.request - The request context.
DefinitionsFactoryException - If the definitions factory throws an
exception.protected String getResourceString()
DEFINITIONS_CONFIG is available, attempts
to retrieve LEGACY_DEFINITIONS_CONFIG. If niether are
available, returns "/WEB-INF/tiles.xml".
protected String getResourceString(Map<String,String> parms)
DEFINITIONS_CONFIG is available, attempts
to retrieve LEGACY_DEFINITIONS_CONFIG. If niether are
available, returns "/WEB-INF/tiles.xml".
parms - The initialization parameters.
protected List<String> getResourceNames(String resourceString)
resourceString - comma seperated resources
protected void checkInit()
IllegalStateException - if the container has already been initialized.
protected void initializeDefinitionsFactory(DefinitionsFactory definitionsFactory,
String resourceString,
Map<String,String> initParameters)
throws TilesException
definitionsFactory - The factory to initialize.resourceString - The string containing a comma-separated-list of
resources.initParameters - A map containing the initialization parameters.
TilesException - If something goes wrong.protected Stack<AttributeContext> getContextStack(TilesRequestContext tilesContext)
tilesContext - The Tiles context object to use.
protected void pushContext(AttributeContext context,
TilesRequestContext tilesContext)
context - The context to push.tilesContext - The Tiles context object to use.protected AttributeContext popContext(TilesRequestContext tilesContext)
tilesContext - The Tiles context object to use.
protected AttributeContext getContext(TilesRequestContext tilesContext)
tilesContext - current Tiles application context.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||