Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tiles.velocity.renderer
Class VelocityAttributeRenderer

    java.lang.Object
      org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer
          org.apache.tiles.renderer.impl.AbstractTypeDetectingAttributeRenderer
              org.apache.tiles.velocity.renderer.VelocityAttributeRenderer

All Implemented Interfaces:
  TilesApplicationContextAware, TilesRequestContextFactoryAware, AttributeEvaluatorFactoryAware, AttributeRenderer, TypeDetectingAttributeRenderer

    public class VelocityAttributeRenderer

extends AbstractTypeDetectingAttributeRenderer

Attribute renderer for rendering Velocity templates as attributes.
It is available only to Servlet-based environment.
It uses `VelocityView` to render the response.
To initialize it correctly, call `setParameter(String, String)` for all the parameters that you want to set, and then call `commit()`.

Since:
  2.2.0
Version:
  $Rev: 821299 $ $Date: 2009-10-03 14:15:05 +0200 (sab, 03 ott 2009) $

Field Summary

Fields inherited from class org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer
`applicationContext, attributeEvaluatorFactory, contextFactory`

Constructor Summary
`VelocityAttributeRenderer()`

Method Summary
`void` | `commit()` Commits the parameters and makes this renderer ready for the use.
`boolean` | `isRenderable(java.lang.Object value, Attribute attribute, TilesRequestContext request)` Checks if this renderer can render an attribute.
`void` | `setParameter(java.lang.String key, java.lang.String value)` Sets a parameter for the internal servlet.
`void` | `write(java.lang.Object value, Attribute attribute, TilesRequestContext request)` Implement this method knowing that the attribute won't be null and it will be authorized.

Methods inherited from class org.apache.tiles.renderer.impl.AbstractTypeDetectingAttributeRenderer
`isRenderable`

Methods inherited from class org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer
`getRequestContext, isPermitted, render, setApplicationContext, setAttributeEvaluatorFactory, setRequestContextFactory`

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.renderer.AttributeRenderer
`render`

Constructor Detail

### VelocityAttributeRenderer

    public VelocityAttributeRenderer()

Method Detail

### setParameter

    public void setParameter(java.lang.String key,
                             java.lang.String value)

  Sets a parameter for the internal servlet.

  Parameters:
    `key` - The name of the parameter.
    `value` - The value of the parameter.
  Since:
    2.2.0

### commit

    public void commit()

  Commits the parameters and makes this renderer ready for the use.

  Since:
    2.2.0

### write

    public void write(java.lang.Object value,
                      Attribute attribute,
                      TilesRequestContext request)
               throws java.io.IOException

  Implement this method knowing that the attribute won't be null and it will be authorized.

  Specified by:
    `write` in class `AbstractBaseAttributeRenderer`
  Parameters:
    `value` - The value of the attribute to be rendered.
    `attribute` - The attribute to render.
    `request` - The Tiles request object.
  Throws:
    `java.io.IOException` - If something goes wrong during rendition.

### isRenderable

    public boolean isRenderable(java.lang.Object value,
                                Attribute attribute,
                                TilesRequestContext request)

  Checks if this renderer can render an attribute. Note that this does not mean it is the best renderer available, but checks only its capability.

  Parameters:
    `value` - The attribute value, already evaluated.
    `attribute` - The attribute to be renderer.
    `request` - The Tiles request context.
  Returns:
    `true` if this renderer can render the attribute.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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