org.apache.tiles.api

## Class TilesContainerWrapper

- java.lang.Object
- - org.apache.tiles.api.TilesContainerWrapper

- All Implemented Interfaces:
    TilesContainer
  Direct Known Subclasses:
    CachingTilesContainer

      public class TilesContainerWrapper
      extends Object
      implements TilesContainer

  Wraps a Tiles container to allow easy decoration.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TilesContainer` | `container` The container to wrap.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TilesContainerWrapper(TilesContainer container)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `endContext(Request request)` Ends a context, where attribute values are stored independently of others. It must be called after a `TilesContainer.startContext(Request)` call.
    `Object` | `evaluate(Attribute attribute, Request request)` Evaluates the given attribute.
    `ApplicationContext` | `getApplicationContext()` Retrieve the container's context.
    `AttributeContext` | `getAttributeContext(Request request)` Retrieve the attribute context of the current request.
    `Definition` | `getDefinition(String definitionName, Request request)` Returns a definition specifying its name.
    `boolean` | `isValidDefinition(String definition, Request request)` Determine whether the definition exists.
    `void` | `prepare(String preparer, Request request)` Executes a preparer.
    `void` | `render(Attribute attribute, Request request)` Render the given Attribute.
    `void` | `render(Definition definition, Request request)` Renders the specified definition.
    `void` | `render(String definition, Request request)` Render the given tiles request.
    `void` | `renderContext(Request request)` Renders the current context, as it is.
    `AttributeContext` | `startContext(Request request)` Starts a new context, where attribute values are stored independently of others. When the use of the contexts is finished, call`TilesContainer.endContext(Request)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### container

          protected TilesContainer container

      The container to wrap.

  - ### Constructor Detail

    - #### TilesContainerWrapper

          public TilesContainerWrapper(TilesContainer container)

      Constructor.
      Parameters:
        `container` - The container to wrap.

  - ### Method Detail

    - #### endContext

          public void endContext(Request request)

      Description copied from interface: `TilesContainer`
      Ends a context, where attribute values are stored independently of others.
      It must be called after a `TilesContainer.startContext(Request)` call.
      Specified by:
        `endContext` in interface `TilesContainer`
      Parameters:
        `request` - The request.

    - #### evaluate

          public Object evaluate(Attribute attribute,
                                 Request request)

      Description copied from interface: `TilesContainer`
      Evaluates the given attribute.
      Specified by:
        `evaluate` in interface `TilesContainer`
      Parameters:
        `attribute` - The attribute to evaluate.
        `request` - The request.
      Returns:
        The evaluated object.

    - #### getApplicationContext

          public ApplicationContext getApplicationContext()

      Description copied from interface: `TilesContainer`
      Retrieve the container's context.
      Specified by:
        `getApplicationContext` in interface `TilesContainer`
      Returns:
        current application context

    - #### getAttributeContext

          public AttributeContext getAttributeContext(Request request)

      Description copied from interface: `TilesContainer`
      Retrieve the attribute context of the current request.
      Specified by:
        `getAttributeContext` in interface `TilesContainer`
      Parameters:
        `request` - The request.
      Returns:
        map of the attributes in the current attribute context.

    - #### getDefinition

          public Definition getDefinition(String definitionName,
                                          Request request)

      Description copied from interface: `TilesContainer`
      Returns a definition specifying its name.
      Specified by:
        `getDefinition` in interface `TilesContainer`
      Parameters:
        `definitionName` - The name of the definition to find.
        `request` - The request context.
      Returns:
        The definition, if found.

    - #### isValidDefinition

          public boolean isValidDefinition(String definition,
                                           Request request)

      Description copied from interface: `TilesContainer`
      Determine whether the definition exists.
      Specified by:
        `isValidDefinition` in interface `TilesContainer`
      Parameters:
        `definition` - the name of the definition.
        `request` - The request.
      Returns:
        true if the definition is found.

    - #### prepare

          public void prepare(String preparer,
                              Request request)

      Description copied from interface: `TilesContainer`
      Executes a preparer.
      Specified by:
        `prepare` in interface `TilesContainer`
      Parameters:
        `preparer` - The name of the preparer to execute.
        `request` - The request.

    - #### render

          public void render(String definition,
                             Request request)

      Description copied from interface: `TilesContainer`
      Render the given tiles request.
      Specified by:
        `render` in interface `TilesContainer`
      Parameters:
        `definition` - the current definition.
        `request` - The request.

    - #### render

          public void render(Definition definition,
                             Request request)

      Description copied from interface: `TilesContainer`
      Renders the specified definition.
      Specified by:
        `render` in interface `TilesContainer`
      Parameters:
        `definition` - The definition to render.
        `request` - The request context.

    - #### render

          public void render(Attribute attribute,
                             Request request)
                      throws IOException

      Description copied from interface: `TilesContainer`
      Render the given Attribute.
      Specified by:
        `render` in interface `TilesContainer`
      Parameters:
        `attribute` - The attribute to render.
        `request` - The request.
      Throws:
        `IOException` - If something goes wrong during writing to the output.

    - #### renderContext

          public void renderContext(Request request)

      Description copied from interface: `TilesContainer`
      Renders the current context, as it is.
      Specified by:
        `renderContext` in interface `TilesContainer`
      Parameters:
        `request` - The request.

    - #### startContext

          public AttributeContext startContext(Request request)

      Description copied from interface: `TilesContainer`
      Starts a new context, where attribute values are stored independently of others.
      When the use of the contexts is finished, call`TilesContainer.endContext(Request)`
      Specified by:
        `startContext` in interface `TilesContainer`
      Parameters:
        `request` - The request.
      Returns:
        The newly created context.

Copyright © 2000–2023 Apache Software Foundation. All rights reserved.