org.apache.tiles.access
Class TilesAccess

Package class diagram package TilesAccess
java.lang.Object
  extended by org.apache.tiles.access.TilesAccess

public final class TilesAccess
extends java.lang.Object

Provides static access to the tiles container.


Field Summary
static java.lang.String CONTAINER_ATTRIBUTE
          The name of the attribute to use when getting and setting the container object in a context.
 
Method Summary
static TilesApplicationContext getApplicationContext(java.lang.Object context)
          Returns the Tiles application context object.
static TilesApplicationContext getApplicationContext(java.lang.Object context, java.lang.String key)
          Returns the Tiles application context object.
static TilesContainer getContainer(java.lang.Object context)
          Finds and returns the default Tiles container object, if it was previously initialized.
static TilesContainer getContainer(java.lang.Object context, java.lang.String key)
          Finds and returns a Tiles container object, if it was previously initialized.
static void setContainer(java.lang.Object context, TilesContainer container)
          Configures the default container to be used in the application.
static void setContainer(java.lang.Object context, TilesContainer container, java.lang.String key)
          Configures the container to be used in the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINER_ATTRIBUTE

public static final java.lang.String CONTAINER_ATTRIBUTE
The name of the attribute to use when getting and setting the container object in a context.

See Also:
Constant Field Values
Method Detail

getContainer

public static TilesContainer getContainer(java.lang.Object context)
Finds and returns the default Tiles container object, if it was previously initialized.

Parameters:
context - The (application) context object to use.
Returns:
The container if it has been configured previously, otherwise null.
See Also:
setContainer(Object, TilesContainer)

getContainer

public static TilesContainer getContainer(java.lang.Object context,
                                          java.lang.String key)
Finds and returns a Tiles container object, if it was previously initialized.

Parameters:
context - The (application) context object to use.
key - The key under which the container is stored.
Returns:
The container if it has been configured previously, otherwise null.
Since:
2.1.0
See Also:
setContainer(Object, TilesContainer)

setContainer

public static void setContainer(java.lang.Object context,
                                TilesContainer container)
Configures the default container to be used in the application.

Parameters:
context - The (application) context object to use.
container - The container object to set.
Throws:
TilesAccessException - If something goes wrong during manipulation of the context.

setContainer

public static void setContainer(java.lang.Object context,
                                TilesContainer container,
                                java.lang.String key)
Configures the container to be used in the application.

Parameters:
context - The (application) context object to use.
container - The container object to set.
key - The key under which the container will be stored.
Throws:
TilesAccessException - If something goes wrong during manipulation of the context.

getApplicationContext

public static TilesApplicationContext getApplicationContext(java.lang.Object context)
Returns the Tiles application context object.

Parameters:
context - The (application) context to use.
Returns:
The required Tiles application context.

getApplicationContext

public static TilesApplicationContext getApplicationContext(java.lang.Object context,
                                                            java.lang.String key)
Returns the Tiles application context object.

Parameters:
context - The (application) context to use.
key - The key under which the container is stored.
Returns:
The required Tiles application context.
Since:
2.1.0