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
Interface AttributeContext

All Known Implementing Classes:
  BasicAttributeContext, BasicAttributeContext, Definition

    public interface AttributeContext

Encapsulation of the current state of execution.

Since:
  Tiles 2.0
Version:
  $Rev: 736275 $ $Date: 2009-01-21 10:58:20 +0100 (mer, 21 gen 2009) $

Method Summary
`void` | `addAll(java.util.Map<java.lang.String,Attribute> newAttributes)` Add all attributes to the context.
`void` | `addMissing(java.util.Map<java.lang.String,Attribute> defaultAttributes)` Add all attributes to the context.
`void` | `clear()` Clear the attributes.
`Attribute` | `getAttribute(java.lang.String name)` Retrieve the named attribute, either cascaded or not.
`java.util.Iterator<java.lang.String>` | `getAttributeNames()` Deprecated. Use `getLocalAttributeNames()` or `getCascadedAttributeNames()`.
`Attribute` | `getCascadedAttribute(java.lang.String name)` Retrieve the attribute that has been cascaded at upper levels.
`java.util.Set<java.lang.String>` | `getCascadedAttributeNames()` Returns the names of the cascaded attributes.
`Attribute` | `getLocalAttribute(java.lang.String name)` Retrieve the attribute that has been defined in this context (i.e. not cascaded).
`java.util.Set<java.lang.String>` | `getLocalAttributeNames()` Returns the names of the local attributes, i.e. the one that have not been cascaded.
`java.lang.String` | `getPreparer()` Get associated preparer instance.
`Attribute` | `getTemplateAttribute()` Returns the attribute that will be used to render a template.
`void` | `inherit(AttributeContext parent)` Copies all missing attributes from the `parent` attribute context to this one.
`void` | `inheritCascadedAttributes(AttributeContext parent)` Copies the cascaded attributes to this attribute context.
`void` | `putAttribute(java.lang.String name, Attribute value)` Add the specified attribute.
`void` | `putAttribute(java.lang.String name, Attribute value, boolean cascade)` Add the specified attribute.
`void` | `setPreparer(java.lang.String url)` Set associated preparer instance.
`void` | `setTemplateAttribute(Attribute templateAttribute)` Sets the template attribute, that will be used to render the template page.

Method Detail

### getTemplateAttribute

    Attribute getTemplateAttribute()

  Returns the attribute that will be used to render a template.

  Returns:
    The template attribute.
  Since:
    2.1.2

### setTemplateAttribute

    void setTemplateAttribute(Attribute templateAttribute)

  Sets the template attribute, that will be used to render the template page.

  Parameters:
    `templateAttribute` - The template attribute.
  Since:
    2.1.2

### getPreparer

    java.lang.String getPreparer()

  Get associated preparer instance.

  Returns:
    The preparer name.
  Since:
    2.1.0

### setPreparer

    void setPreparer(java.lang.String url)

  Set associated preparer instance.

  Parameters:
    `url` - The preparer name.
  Since:
    2.1.0

### addAll

    void addAll(java.util.Map<java.lang.String,Attribute> newAttributes)

  Add all attributes to the context.

  Parameters:
    `newAttributes` - the attributes to be added.

### addMissing

    void addMissing(java.util.Map<java.lang.String,Attribute> defaultAttributes)

  Add all attributes to the context.

  Parameters:
    `defaultAttributes` - attributes which should be present.

### inheritCascadedAttributes

    void inheritCascadedAttributes(AttributeContext parent)

  Copies the cascaded attributes to this attribute context.

  Parameters:
    `parent` - The parent context to be used.
  Since:
    2.1.0

### inherit

    void inherit(AttributeContext parent)

  Copies all missing attributes from the `parent` attribute context to this one.

  Parameters:
    `parent` - The attribute context to copy attributes from.
  Since:
    2.1.0

### getAttribute

    Attribute getAttribute(java.lang.String name)

  Retrieve the named attribute, either cascaded or not.

  Parameters:
    `name` - key name for the attribute.
  Returns:
    Attribute associated with the given name.

### getLocalAttribute

    Attribute getLocalAttribute(java.lang.String name)

  Retrieve the attribute that has been defined in this context (i.e. not cascaded).

  Parameters:
    `name` - key name for the attribute.
  Returns:
    Attribute The local attribute associated with the given name, if present, or `null` otherwise.
  Since:
    2.1.0

### getCascadedAttribute

    Attribute getCascadedAttribute(java.lang.String name)

  Retrieve the attribute that has been cascaded at upper levels.

  Parameters:
    `name` - key name for the attribute.
  Returns:
    Attribute The cascaded attribute associated with the given name, if present, or `null` otherwise.
  Since:
    2.1.0

### getAttributeNames

    @Deprecated
    java.util.Iterator<java.lang.String> getAttributeNames()

  Deprecated. Use `getLocalAttributeNames()` or `getCascadedAttributeNames()`.

  Iterator of all attribute names.

  Returns:
    iterator of all names.

### getLocalAttributeNames

    java.util.Set<java.lang.String> getLocalAttributeNames()

  Returns the names of the local attributes, i.e. the one that have not been cascaded.

  Returns:
    The local attribute names.
  Since:
    2.1.0

### getCascadedAttributeNames

    java.util.Set<java.lang.String> getCascadedAttributeNames()

  Returns the names of the cascaded attributes.

  Returns:
    The cascaded attribute names.
  Since:
    2.1.0

### putAttribute

    void putAttribute(java.lang.String name,
                      Attribute value)

  Add the specified attribute. The attribute value will be available only in the current context, i.e. it is like calling `putAttribute(String, Attribute, boolean)` with `cascade = false`.

  Parameters:
    `name` - name of the attribute
    `value` - value of the attribute

### putAttribute

    void putAttribute(java.lang.String name,
                      Attribute value,
                      boolean cascade)

  Add the specified attribute.

  Parameters:
    `name` - name of the attribute
    `value` - value of the attribute
    `cascade` - If `true`, the attribute value will be available in all nested contexts. If `false`, it will be available only in the current context.
  Since:
    2.1.0

### clear

    void clear()

  Clear the attributes.

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.