org.apache.tiles.core.impl.mgmt

## Class CachingTilesContainer

- java.lang.Object
- - org.apache.tiles.api.TilesContainerWrapper
  - - org.apache.tiles.core.impl.mgmt.CachingTilesContainer

- All Implemented Interfaces:
    MutableTilesContainer, TilesContainer

      public class CachingTilesContainer
      extends TilesContainerWrapper
      implements MutableTilesContainer

  Manages custom and configured definitions, so they can be used by the container, instead of using a simple `DefinitionsFactory`.

- - ### Field Summary

    - ### Fields inherited from class org.apache.tiles.api.TilesContainerWrapper

      `container`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CachingTilesContainer(TilesContainer originalContainer)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Definition` | `getDefinition(String definition, Request request)` Returns a definition by name.
    `boolean` | `isValidDefinition(String definition, Request request)` Determine whether the definition exists.
    `void` | `register(Definition definition, Request request)` Register a new definition with the container.
    `void` | `render(String definition, Request request)` Render the given tiles request.

    - ### Methods inherited from class org.apache.tiles.api.TilesContainerWrapper

      `endContext, evaluate, getApplicationContext, getAttributeContext, prepare, render, render, renderContext, startContext`

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

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

    - ### Methods inherited from interface org.apache.tiles.api.TilesContainer

      `endContext, evaluate, getApplicationContext, getAttributeContext, prepare, render, render, renderContext, startContext`

- - ### Constructor Detail

    - #### CachingTilesContainer

          public CachingTilesContainer(TilesContainer originalContainer)

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

  - ### Method Detail

    - #### getDefinition

          public Definition getDefinition(String definition,
                                          Request request)

      Returns a definition by name.
      Specified by:
        `getDefinition` in interface `TilesContainer`
      Overrides:
        `getDefinition` in class `TilesContainerWrapper`
      Parameters:
        `definition` - The name of the definition.
        `request` - The current request.
      Returns:
        The requested definition, either main or custom.

    - #### isValidDefinition

          public boolean isValidDefinition(String definition,
                                           Request request)

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

    - #### register

          public void register(Definition definition,
                               Request request)

      Register a new definition with the container.
      Specified by:
        `register` in interface `MutableTilesContainer`
      Parameters:
        `definition` - The definition to register.
        `request` - TODO

    - #### render

          public void render(String definition,
                             Request request)

      Render the given tiles request.
      Specified by:
        `render` in interface `TilesContainer`
      Overrides:
        `render` in class `TilesContainerWrapper`
      Parameters:
        `definition` - the current definition.
        `request` - The request.

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