Top Description Fields Constructors Methods
org.springframework.beans

public Class BeanMetadataAttributeAccessor

extends AttributeAccessorSupport
implements BeanMetadataElement
Class Inheritance
All Implemented Interfaces
org.springframework.beans.BeanMetadataElement
Known Direct Subclasses
org.springframework.beans.PropertyValue, org.springframework.beans.factory.support.AbstractBeanDefinition, org.springframework.beans.factory.support.AutowireCandidateQualifier
Annotations
@SuppressWarnings:serial
Imports
org.springframework.core.AttributeAccessorSupport, org.springframework.lang.Nullable

Extension of org.springframework.core.AttributeAccessorSupport, holding attributes as BeanMetadataAttribute objects in order to keep track of the definition source.
Author
Juergen Hoeller
Since
2.5

Field Summary

Modifier and TypeField and Description
private Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addMetadataAttribute(BeanMetadataAttribute
the BeanMetadataAttribute object to register
attribute
)

Add the given BeanMetadataAttribute to this accessor's set of attributes.

public Object
getAttribute(String
the unique attribute key
name
)

Overrides org.springframework.core.AttributeAccessorSupport.getAttribute.

Implements org.springframework.core.AttributeAccessor.getAttribute.

Get the value of the attribute identified by name.
public BeanMetadataAttribute

Returns:

the corresponding BeanMetadataAttribute object, or null if no such attribute defined
getMetadataAttribute
(String
the name of the attribute
name
)

Look up the given BeanMetadataAttribute in this accessor's set of attributes.

public Object
getSource()

Overrides default org.springframework.beans.BeanMetadataElement.getSource.

Return the configuration source Object for this metadata element (may be null).
public Object
removeAttribute(String
the unique attribute key
name
)

Overrides org.springframework.core.AttributeAccessorSupport.removeAttribute.

Implements org.springframework.core.AttributeAccessor.removeAttribute.

Remove the attribute identified by name and return its value.
public void
setAttribute(String
the unique attribute key
name
,
Object
the attribute value to be attached
value
)

Overrides org.springframework.core.AttributeAccessorSupport.setAttribute.

Implements org.springframework.core.AttributeAccessor.setAttribute.

Set the attribute defined by name to the supplied value.
public void
setSource(Object source)

Set the configuration source Object for this metadata element.

Inherited from org.springframework.core.AttributeAccessorSupport:
attributeNamescomputeAttributecopyAttributesFromequalshasAttributehashCode

Field Detail

sourceback to summary
private Object source
Annotations
@Nullable

Constructor Detail

BeanMetadataAttributeAccessorback to summary
public BeanMetadataAttributeAccessor()

Method Detail

addMetadataAttributeback to summary
public void addMetadataAttribute(BeanMetadataAttribute attribute)

Add the given BeanMetadataAttribute to this accessor's set of attributes.

Parameters
attribute:BeanMetadataAttribute

the BeanMetadataAttribute object to register

getAttributeback to summary
public Object getAttribute(String name)

Overrides org.springframework.core.AttributeAccessorSupport.getAttribute.

Implements org.springframework.core.AttributeAccessor.getAttribute.

Doc from org.springframework.core.AttributeAccessor.getAttribute.

Get the value of the attribute identified by name.

Return null if the attribute doesn't exist.

Parameters
name:String

the unique attribute key

Returns:Object

the current value of the attribute, if any

Annotations
@Override
@Nullable
getMetadataAttributeback to summary
public BeanMetadataAttribute getMetadataAttribute(String name)

Look up the given BeanMetadataAttribute in this accessor's set of attributes.

Parameters
name:String

the name of the attribute

Returns:BeanMetadataAttribute

the corresponding BeanMetadataAttribute object, or null if no such attribute defined

Annotations
@Nullable
getSourceback to summary
public Object getSource()

Overrides default org.springframework.beans.BeanMetadataElement.getSource.

Doc from org.springframework.beans.BeanMetadataElement.getSource.

Return the configuration source Object for this metadata element (may be null).

Annotations
@Override
@Nullable
removeAttributeback to summary
public Object removeAttribute(String name)

Overrides org.springframework.core.AttributeAccessorSupport.removeAttribute.

Implements org.springframework.core.AttributeAccessor.removeAttribute.

Doc from org.springframework.core.AttributeAccessor.removeAttribute.

Remove the attribute identified by name and return its value.

Return null if no attribute under name is found.

Parameters
name:String

the unique attribute key

Returns:Object

the last value of the attribute, if any

Annotations
@Override
@Nullable
setAttributeback to summary
public void setAttribute(String name, Object value)

Overrides org.springframework.core.AttributeAccessorSupport.setAttribute.

Implements org.springframework.core.AttributeAccessor.setAttribute.

Doc from org.springframework.core.AttributeAccessor.setAttribute.

Set the attribute defined by name to the supplied value.

If value is null, the attribute is removed.

In general, users should take care to prevent overlaps with other metadata attributes by using fully-qualified names, perhaps using class or package names as prefix.

Parameters
name:String

the unique attribute key

value:Object

the attribute value to be attached

Annotations
@Override
setSourceback to summary
public void setSource(Object source)

Set the configuration source Object for this metadata element.

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