Package org.springframework.beans

# Class BeanMetadataAttributeAccessor

java.lang.Object
org.springframework.core.AttributeAccessorSupport
org.springframework.beans.BeanMetadataAttributeAccessor

All Implemented Interfaces:
  `Serializable`, `BeanMetadataElement`, `org.springframework.core.AttributeAccessor`

Direct Known Subclasses:
  `AbstractBeanDefinition`, `AutowireCandidateQualifier`, `PropertyValue`

public class BeanMetadataAttributeAccessor extends org.springframework.core.AttributeAccessorSupport implements BeanMetadataElement
Extension of `AttributeAccessorSupport`, holding attributes as `BeanMetadataAttribute` objects in order to keep track of the definition source.

Since:
  2.5
Author:
  Juergen Hoeller
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`BeanMetadataAttributeAccessor()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addMetadataAttribute(BeanMetadataAttribute attribute)`
Add the given BeanMetadataAttribute to this accessor's set of attributes.
`Object`
`getAttribute(String name)`
`BeanMetadataAttribute`
`getMetadataAttribute(String name)`
Look up the given BeanMetadataAttribute in this accessor's set of attributes.
`Object`
`getSource()`
Return the configuration source `Object` for this metadata element (may be `null`).
`Object`
`removeAttribute(String name)`
`void`
`setAttribute(String name, Object value)`
`void`
`setSource(Object source)`
Set the configuration source `Object` for this metadata element.

### Methods inherited from class org.springframework.core.AttributeAccessorSupport

`attributeNames, computeAttribute, copyAttributesFrom, equals, hasAttribute, hashCode`

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

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

## Constructor Details

### BeanMetadataAttributeAccessor

public BeanMetadataAttributeAccessor()

## Method Details

### setSource

public void setSource(@Nullable Object source)
Set the configuration source `Object` for this metadata element.

The exact type of the object will depend on the configuration mechanism used.

### getSource

@Nullable public Object getSource()
Description copied from interface: `BeanMetadataElement`
Return the configuration source `Object` for this metadata element (may be `null`).

Specified by:
  `getSource` in interface `BeanMetadataElement`

### addMetadataAttribute

public void addMetadataAttribute(BeanMetadataAttribute attribute)
Add the given BeanMetadataAttribute to this accessor's set of attributes.

Parameters:
  `attribute` - the BeanMetadataAttribute object to register

### getMetadataAttribute

@Nullable public BeanMetadataAttribute getMetadataAttribute(String name)
Look up the given BeanMetadataAttribute in this accessor's set of attributes.

Parameters:
  `name` - the name of the attribute
Returns:
  the corresponding BeanMetadataAttribute object, or `null` if no such attribute defined

### setAttribute

public void setAttribute(String name, @Nullable Object value)

Specified by:
  `setAttribute` in interface `org.springframework.core.AttributeAccessor`
Overrides:
  `setAttribute` in class `org.springframework.core.AttributeAccessorSupport`

### getAttribute

@Nullable public Object getAttribute(String name)

Specified by:
  `getAttribute` in interface `org.springframework.core.AttributeAccessor`
Overrides:
  `getAttribute` in class `org.springframework.core.AttributeAccessorSupport`

### removeAttribute

@Nullable public Object removeAttribute(String name)

Specified by:
  `removeAttribute` in interface `org.springframework.core.AttributeAccessor`
Overrides:
  `removeAttribute` in class `org.springframework.core.AttributeAccessorSupport`