org.apache.tiles.template

## Class AddAttributeModel

- java.lang.Object
- - org.apache.tiles.template.AddAttributeModel

-     public class AddAttributeModel
      extends Object

  Add an element to the surrounding list. Equivalent to 'putAttribute', but for list element.

  Add an element to the surrounding list. This tag can only be used inside 'putListAttribute' or 'addListAttribute' tags. Value can come from a direct assignment (value="aValue")

  Since:
    2.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AddAttributeModel()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute(Object value, String expression, String role, String type, Request request, ModelBody modelBody)` Executes the operation.

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

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

- - ### Constructor Detail

    - #### AddAttributeModel

          public AddAttributeModel()

  - ### Method Detail

    - #### execute

          public void execute(Object value,
                              String expression,
                              String role,
                              String type,
                              Request request,
                              ModelBody modelBody)
                       throws IOException

      Executes the operation.
      Parameters:
        `value` - The value of the attribute. Use this parameter, or expression, or body.
        `expression` - The expression to calculate the value from. Use this parameter, or value, or body.
        `role` - A comma-separated list of roles. If present, the attribute will be rendered only if the current user belongs to one of the roles.
        `type` - The type (renderer) of the attribute.
        `request` - The request.
        `modelBody` - The body.
      Throws:
        `IOException` - If the body cannot be correctly evaluated.
      Since:
        2.2.0

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