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

org.apache.tiles
Interface TilesContainer

Package class diagram package TilesContainer
All Known Subinterfaces:
MutableTilesContainer
All Known Implementing Classes:
BasicTilesContainer, CachingKeyedDefinitionsFactoryTilesContainer, CachingTilesContainer, KeyedDefinitionsFactoryTilesContainer

public interface TilesContainer

An encapsulation of the tiles framework. This interface is used to expose tiles features to frameworks which leverage it as a plugin. It can alternately be used by web applications which would like a programmatic interface.

Since:
2.0
Version:
$Rev: 637581 $ $Date: 2008-03-16 12:53:26 +0100 (Sun, 16 Mar 2008) $

Method Summary
 void endContext(Object... requestItems)
          Ends a context, where attribute values are stored independently from others.
 TilesApplicationContext getApplicationContext()
          Retrieve the containers context.
 AttributeContext getAttributeContext(Object... requestItems)
          Retrive the attribute context of the current request.
 void init(Map<String,String> initParameters)
          Initialize the container with the given configuration.
 boolean isValidDefinition(String definition, Object... requestItems)
          Determine whether or not the definition exists.
 void prepare(String preparer, Object... requestItems)
          Executes a preparer.
 void render(Attribute attribute, Writer writer, Object... requestItems)
          Render the given Attribute.
 void render(String definition, Object... requestItems)
          Render the given tiles request.
 AttributeContext startContext(Object... requestItems)
          Starts a new context, where attribute values are stored independently from others.
 

Method Detail

init

void init(Map<String,String> initParameters)
          throws TilesException
Initialize the container with the given configuration.

Parameters:
initParameters - application context
Throws:
TilesException - when an initialization error occurs

getApplicationContext

TilesApplicationContext getApplicationContext()
Retrieve the containers context.

Returns:
current application context

getAttributeContext

AttributeContext getAttributeContext(Object... requestItems)
Retrive the attribute context of the current request.

Parameters:
requestItems - the current request objects.
Returns:
map of the attributes in the current attribute context.

startContext

AttributeContext startContext(Object... requestItems)
Starts a new context, where attribute values are stored independently from others.
When the use of the contexts is finished, call endContext(Object...)

Parameters:
requestItems - the current request objects.
Returns:
The newly created context.

endContext

void endContext(Object... requestItems)
Ends a context, where attribute values are stored independently from others.
It must be called after a startContext(Object...) call.

Parameters:
requestItems - the current request objects.

prepare

void prepare(String preparer,
             Object... requestItems)
             throws TilesException
Executes a preparer.

Parameters:
preparer - The name of the preparer to execute.
requestItems - the current request objects.
Throws:
TilesException - is processing fails.

render

void render(String definition,
            Object... requestItems)
            throws TilesException
Render the given tiles request.

Parameters:
definition - the current definition.
requestItems - the current request objects.
Throws:
TilesException - is processing fails.

render

void render(Attribute attribute,
            Writer writer,
            Object... requestItems)
            throws TilesException,
                   IOException
Render the given Attribute.

Parameters:
attribute - The attribute to render.
writer - The writer to use when rendering an attribute of "string" type.
requestItems - the current request objects.
Throws:
TilesException - If something goes wrong during accessing Tiles elements.
IOException - If something goes wrong during writing to the output.

isValidDefinition

boolean isValidDefinition(String definition,
                          Object... requestItems)
Determine whether or not the definition exists.

Parameters:
definition - the name of the definition.
requestItems - the current request objects.
Returns:
true if the definition is found.


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