org.apache.tiles.velocity.template

## Class VelocityStyleTilesTool

- java.lang.Object
- - org.apache.tiles.velocity.template.ContextHolder
  - - org.apache.tiles.velocity.template.VelocityStyleTilesTool

-     public class VelocityStyleTilesTool
      extends ContextHolder

  Tiles Tool to be used "the classic way".
  Since:
    2.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VelocityStyleTilesTool()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Attribute` | `clone(Attribute attribute)` Creates an attribute that is a copy of the one passed as a parameter.
    `Attribute` | `createAttribute()` Creates a new empty attribute.
    `Attribute` | `createTemplateAttribute(String template)` Creates an attribute that represents a template.
    `protected Request` | `createVelocityRequest(javax.servlet.ServletContext servletContext, Writer writer)` Creates a Velocity request.
    `VelocityStyleTilesTool` | `endAttributeContext()` Ends the current attribute context.
    `Attribute` | `get(String key)` Returns an attribute.
    `AttributeContext` | `getAttributeContext()` Returns the current attribute context.
    `org.apache.velocity.runtime.Renderable` | `render(Attribute attribute)` Renders an attribute.
    `org.apache.velocity.runtime.Renderable` | `renderAttributeContext()` Renders the current attribute context.
    `org.apache.velocity.runtime.Renderable` | `renderDefinition(String definitionName)` Renders a definition.
    `VelocityStyleTilesTool` | `setCurrentContainer(String containerKey)` Sets the current container for the current request.
    `AttributeContext` | `startAttributeContext()` Starts the attribute context.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.tiles.velocity.template.ContextHolder

      `getRequest, getResponse, getServletContext, getVelocityContext, setRequest, setResponse, setServletContext, setVelocityContext`

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

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

- - ### Constructor Detail

    - #### VelocityStyleTilesTool

          public VelocityStyleTilesTool()

  - ### Method Detail

    - #### get

          public Attribute get(String key)

      Returns an attribute.
      Parameters:
        `key` - The name of the attribute to get.
      Returns:
        The Attribute.
      Since:
        2.2.0

    - #### createAttribute

          public Attribute createAttribute()

      Creates a new empty attribute.
      Returns:
        The created attribute.
      Since:
        2.2.0

    - #### clone

          public Attribute clone(Attribute attribute)

      Creates an attribute that is a copy of the one passed as a parameter.
      Parameters:
        `attribute` - The attribute to copy.
      Returns:
        The copied attribute.
      Since:
        2.2.0

    - #### createTemplateAttribute

          public Attribute createTemplateAttribute(String template)

      Creates an attribute that represents a template.
      Parameters:
        `template` - The template.
      Returns:
        The attribute.
      Since:
        2.2.0

    - #### render

          public org.apache.velocity.runtime.Renderable render(Attribute attribute)

      Renders an attribute.
      Parameters:
        `attribute` - The attribute to render.
      Returns:
        The renderable object, ready to be rendered.
      Since:
        2.2.0

    - #### renderDefinition

          public org.apache.velocity.runtime.Renderable renderDefinition(String definitionName)

      Renders a definition. It can be used in conjunction with `startAttributeContext()` and `endAttributeContext()` to customize appearance.
      Parameters:
        `definitionName` - The name of the definition to render.
      Returns:
        The renderable that renders the definition.
      Since:
        2.2.0

    - #### renderAttributeContext

          public org.apache.velocity.runtime.Renderable renderAttributeContext()

      Renders the current attribute context. It can be used in conjunction with `startAttributeContext()` and `endAttributeContext()` to customize appearance.
      Returns:
        The renderable that renders the current attribute context.
      Since:
        2.2.0

    - #### startAttributeContext

          public AttributeContext startAttributeContext()

      Starts the attribute context. Remember to call `endAttributeContext()` when finished!
      Returns:
        The started attribute context, ready to be customized.
      Since:
        2.2.0

    - #### endAttributeContext

          public VelocityStyleTilesTool endAttributeContext()

      Ends the current attribute context. To be called after `startAttributeContext()`.
      Returns:
        The tool itself.
      Since:
        2.2.0

    - #### getAttributeContext

          public AttributeContext getAttributeContext()

      Returns the current attribute context.
      Returns:
        The current attribute context.
      Since:
        2.2.0

    - #### setCurrentContainer

          public VelocityStyleTilesTool setCurrentContainer(String containerKey)

      Sets the current container for the current request.
      Parameters:
        `containerKey` - The key of the container to set as "current" for the current request.
      Returns:
        The tool itself.
      Since:
        2.2.0

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### createVelocityRequest

          protected Request createVelocityRequest(javax.servlet.ServletContext servletContext,
                                                  Writer writer)

      Creates a Velocity request.
      Parameters:
        `servletContext` - The servlet context.
        `writer` - The writer.
      Returns:
        The created request.

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