Package org.apache.tiles.api

# Class Definition

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

All Implemented Interfaces:
  `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
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `inherit`
  Extends attribute value.
  `protected String`
  `name`
  Definition name.

  ### Fields inherited from class org.apache.tiles.api.BasicAttributeContext

  `attributes, cascadedAttributes, preparer, templateAttribute`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Definition()`
  Constructor.
  `Definition(String name, Attribute templateAttribute, Map<String,Attribute> attributes)`
  Constructor.
  `Definition(Definition definition)`
  Copy Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `String`
  `getExtends()`
  Get extends.
  `String`
  `getName()`
  Access method for the name property.
  `int`
  `hashCode()`
  `boolean`
  `isExtending()`
  Get extends flag.
  `void`
  `setExtends(String name)`
  Set extends.
  `void`
  `setName(String aName)`
  Sets the value of the name property.
  `String`
  `toString()`
  Returns a description of the attributes.

  ### Methods inherited from class org.apache.tiles.api.BasicAttributeContext

  `addAll, clear, getAttribute, 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 Details

  - ### inherit

    protected String inherit
    Extends attribute value.

  - ### name

    protected String name
    Definition name.

- ## Constructor Details

  - ### 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(String name, Attribute templateAttribute, Map<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 Details

  - ### getName

    public String getName()
    Access method for the name property.
    Returns:
      the current value of the name property

  - ### setName

    public void setName(String aName)
    Sets the value of the name property.
    Parameters:
      `aName` - the new value of the name property

  - ### setExtends

    public void setExtends(String name)
    Set extends.
    Parameters:
      `name` - Name of the extended definition.

  - ### getExtends

    public String getExtends()
    Get extends.
    Returns:
      Name of the extended definition.

  - ### equals

    public boolean equals(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 String toString()
    Returns a description of the attributes.
    Overrides:
      `toString` in class `Object`
    Returns:
      A string representation of the content of this definition.