Attribute (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.map, class: Attribute

# Class Attribute<E extends Entity<E,A,R>, A extends Attribute<E,A,R>, R extends Relationship<E,A,R>>

java.lang.Object
org.apache.cayenne.map.Attribute<E,A,R>

All Implemented Interfaces:
  `Serializable, CayenneMapEntry, XMLSerializable`

Direct Known Subclasses:
  `DbAttribute, ObjAttribute`

public abstract class Attribute<E extends Entity<E,A,R>, A extends Attribute<E,A,R>, R extends Relationship<E,A,R>> extends Object implements CayenneMapEntry, XMLSerializable, Serializable
Defines a property descriptor that is a part of an Entity. Two examples of things that are described by attributes are Java class properties and database table columns.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Entity<E,A,R>`
  `entity`
  `protected String`
  `name`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Attribute()`
  Creates an unnamed Attribute.
  `Attribute(String name)`
  Creates a named Attribute.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract void`
  `encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor<?> delegate)`
  Prints itself as XML to the provided XMLEncoder.
  `Entity<E,A,R>`
  `getEntity()`
  Returns parent entity that holds this attribute.
  `String`
  `getName()`
  Returns the name property of this object.
  `Object`
  `getParent()`
  Returns the parent map.
  `void`
  `setEntity(Entity<E,A,R> entity)`
  Sets parent entity that holds this attribute.
  `void`
  `setName(String name)`
  `void`
  `setParent(Object parent)`
  Stores the parent map.
  `String`
  `toString()`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### name

    protected String name

  - ### entity

    protected Entity<E extends Entity<E,A,R>, A extends Attribute<E,A,R>, R extends Relationship<E,A,R>> entity

- ## Constructor Details

  - ### Attribute

    public Attribute()
    Creates an unnamed Attribute.

  - ### Attribute

    public Attribute(String name)
    Creates a named Attribute.

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### encodeAsXML

    public abstract void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor<?> delegate)
    Description copied from interface: `XMLSerializable`
    Prints itself as XML to the provided XMLEncoder.
    Specified by:
      `encodeAsXML` in interface `XMLSerializable`

  - ### getEntity

    public Entity<E,A,R> getEntity()
    Returns parent entity that holds this attribute.

  - ### setEntity

    public void setEntity(Entity<E,A,R> entity)
    Sets parent entity that holds this attribute.

  - ### getName

    public String getName()
    Description copied from interface: `CayenneMapEntry`
    Returns the name property of this object.
    Specified by:
      `getName` in interface `CayenneMapEntry`
    Returns:
      name of this entry.

  - ### setName

    public void setName(String name)

  - ### getParent

    public Object getParent()
    Description copied from interface: `CayenneMapEntry`
    Returns the parent map.
    Specified by:
      `getParent` in interface `CayenneMapEntry`

  - ### setParent

    public void setParent(Object parent)
    Description copied from interface: `CayenneMapEntry`
    Stores the parent map.
    Specified by:
      `setParent` in interface `CayenneMapEntry`