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
Class Definition

    java.lang.Object
      org.apache.tiles.BasicAttributeContext
          org.apache.tiles.Definition

All Implemented Interfaces:
  java.io.Serializable, AttributeContext

    public class Definition

extends BasicAttributeContext

A definition, i.e. a template with (completely or not) filled attributes. Attributes of a template can be defined with the help of this class.
It can be used as a data transfer object used for registering new definitions with the Container.

Since:
  Tiles 2.0
Version:
  $Rev: 822418 $ $Date: 2009-10-06 20:34:05 +0200 (mar, 06 ott 2009) $
See Also:
  Serialized Form

Field Summary
`protected java.lang.String` | `inherit` Extends attribute value.
`protected java.lang.String` | `name` Definition name.

Fields inherited from class org.apache.tiles.BasicAttributeContext
`attributes, cascadedAttributes, preparer, templateAttribute`

Constructor Summary
`Definition()` Constructor.
`Definition(Definition definition)` Copy Constructor.
`Definition(java.lang.String name, Attribute templateAttribute, java.util.Map<java.lang.String,Attribute> attributes)` Constructor.
`Definition(java.lang.String name, java.lang.String template, java.util.Map<java.lang.String,Attribute> attributes)` Deprecated. Use `Definition(String, Attribute, Map)`.

Method Summary
`void` | `addAttribute(Attribute attribute)` Deprecated. Use `BasicAttributeContext.putAttribute(String, Attribute)`.
`boolean` | `equals(java.lang.Object obj)`
`java.util.Map<java.lang.String,Attribute>` | `getAttributes()` Deprecated. Use `AttributeContext.getLocalAttributeNames()` and `AttributeContext.getCascadedAttributeNames()`.
`java.lang.String` | `getExtends()` Get extends.
`java.lang.String` | `getName()` Access method for the name property.
`java.lang.String` | `getRole()` Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.
`java.lang.String` | `getTemplate()` Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.
`boolean` | `hasAttributeValue(java.lang.String key)` Deprecated. Check if the `AttributeContext.getAttribute(String)` returns null.
`int` | `hashCode()`
`boolean` | `isExtending()` Get extends flag.
`void` | `put(java.lang.String name, java.lang.Object content)` Deprecated. Use `AttributeContext.putAttribute(String, Attribute)` or `AttributeContext.putAttribute(String, Attribute, boolean)`.
`void` | `put(java.lang.String name, java.lang.Object content, Attribute.AttributeType type, java.lang.String role)` Deprecated. Use `AttributeContext.putAttribute(String, Attribute)` or `AttributeContext.putAttribute(String, Attribute, boolean)`.
`void` | `put(java.lang.String name, java.lang.Object content, java.lang.String role)` Deprecated. Use `AttributeContext.putAttribute(String, Attribute)` or `AttributeContext.putAttribute(String, Attribute, boolean)`.
`void` | `setExtends(java.lang.String name)` Set extends.
`void` | `setName(java.lang.String aName)` Sets the value of the name property.
`void` | `setRole(java.lang.String role)` Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.
`void` | `setTemplate(java.lang.String template)` Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.
`java.lang.String` | `toString()` Returns a description of the attributes.

Methods inherited from class org.apache.tiles.BasicAttributeContext
`addAll, addMissing, clear, getAttribute, getAttributeNames, getCascadedAttribute, getCascadedAttributeNames, getLocalAttribute, getLocalAttributeNames, getPreparer, getTemplateAttribute, inherit, inherit, inheritCascadedAttributes, putAttribute, putAttribute, setPreparer, setTemplateAttribute`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### inherit

    protected java.lang.String inherit

  Extends attribute value.

### name

    protected java.lang.String name

  Definition name.

Constructor Detail

### Definition

    public Definition()

  Constructor.

### Definition

    public Definition(Definition definition)

  Copy Constructor. Create a new definition initialized with parent definition. Do a shallow copy : attributes are shared between copies, but not the Map containing attributes.

  Parameters:
    `definition` - The definition to copy.

### Definition

    public Definition(java.lang.String name,
                      java.lang.String template,
                      java.util.Map<java.lang.String,Attribute> attributes)

  Deprecated. Use `Definition(String, Attribute, Map)`.

  Constructor.

  Parameters:
    `name` - The name of the definition.
    `template` - The template of the definition.
    `attributes` - The attribute map of the definition.

### Definition

    public Definition(java.lang.String name,
                      Attribute templateAttribute,
                      java.util.Map<java.lang.String,Attribute> attributes)

  Constructor.

  Parameters:
    `name` - The name of the definition.
    `templateAttribute` - The template attribute of the definition.
    `attributes` - The attribute map of the definition.
  Since:
    2.1.2

Method Detail

### getName

    public java.lang.String getName()

  Access method for the name property.

  Returns:
    the current value of the name property

### setName

    public void setName(java.lang.String aName)

  Sets the value of the name property.

  Parameters:
    `aName` - the new value of the name property

### getTemplate

    @Deprecated
    public java.lang.String getTemplate()

  Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.

  Access method for the template property.

  Returns:
    the current value of the template property

### setTemplate

    @Deprecated
    public void setTemplate(java.lang.String template)

  Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.

  Sets the value of the template property.

  Parameters:
    `template` - the new value of the path property

### getRole

    @Deprecated
    public java.lang.String getRole()

  Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.

  Access method for the role property.

  Returns:
    the current value of the role property

### setRole

    @Deprecated
    public void setRole(java.lang.String role)

  Deprecated. Use `BasicAttributeContext.getTemplateAttribute()`.

  Sets the value of the role property.

  Parameters:
    `role` - the new value of the role property

### getAttributes

    @Deprecated
    public java.util.Map<java.lang.String,Attribute> getAttributes()

  Deprecated. Use `AttributeContext.getLocalAttributeNames()` and `AttributeContext.getCascadedAttributeNames()`.

  Access method for the attributes property. If there is no attributes, return an empty map.

  Returns:
    the current value of the attributes property

### addAttribute

    @Deprecated
    public void addAttribute(Attribute attribute)

  Deprecated. Use `BasicAttributeContext.putAttribute(String, Attribute)`.

  Add an attribute to this definition.

  This method is used by Digester to load definitions.

  Parameters:
    `attribute` - Attribute to add.

### hasAttributeValue

    @Deprecated
    public boolean hasAttributeValue(java.lang.String key)

  Deprecated. Check if the `AttributeContext.getAttribute(String)` returns null.

  Checks whether the `key` attribute has been set.

  Parameters:
    `key` - The attribute key to check.
  Returns:
    `true` if the attribute has a value.

### put

    @Deprecated
    public void put(java.lang.String name,
                               java.lang.Object content)

  Deprecated. Use `AttributeContext.putAttribute(String, Attribute)` or `AttributeContext.putAttribute(String, Attribute, boolean)`.

  Put an attribute in template definition. Attribute can be used as content for tag get.

  Parameters:
    `name` - Attribute name
    `content` - Attribute value

### put

    @Deprecated
    public void put(java.lang.String name,
                               java.lang.Object content,
                               java.lang.String role)

  Deprecated. Use `AttributeContext.putAttribute(String, Attribute)` or `AttributeContext.putAttribute(String, Attribute, boolean)`.

  Put an attribute in template definition. Attribute can be used as content for tag get.

  Parameters:
    `name` - Attribute name
    `content` - Attribute value
    `role` - Determine if content is used by get tag. If user is in role, content is used.

### put

    @Deprecated
    public void put(java.lang.String name,
                               java.lang.Object content,
                               Attribute.AttributeType type,
                               java.lang.String role)

  Deprecated. Use `AttributeContext.putAttribute(String, Attribute)` or `AttributeContext.putAttribute(String, Attribute, boolean)`.

  Put an attribute in template definition. Attribute can be used as content for tag get.

  Parameters:
    `name` - Attribute name
    `content` - Attribute value
    `type` - attribute type: template, string, definition
    `role` - Determine if content is used by get tag. If user is in role, content is used.

### setExtends

    public void setExtends(java.lang.String name)

  Set extends.

  Parameters:
    `name` - Name of the extended definition.

### getExtends

    public java.lang.String getExtends()

  Get extends.

  Returns:
    Name of the extended definition.

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `BasicAttributeContext`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `BasicAttributeContext`

### isExtending

    public boolean isExtending()

  Get extends flag.

  Returns:
    `true` if this definition extends another.

### toString

    public java.lang.String toString()

  Returns a description of the attributes.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    A string representation of the content of this definition.

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.