|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.AttributeAccessorSupport org.springframework.beans.BeanMetadataAttributeAccessor
public class BeanMetadataAttributeAccessor
Extension of AttributeAccessorSupport
,
holding attributes as BeanMetadataAttribute
objects in order
to keep track of the definition source.
Constructor Summary | |
---|---|
BeanMetadataAttributeAccessor()
|
Method Summary | |
---|---|
void |
addMetadataAttribute(BeanMetadataAttribute attribute)
Add the given BeanMetadataAttribute to this accessor's set of attributes. |
Object |
getAttribute(String name)
Get the value of the attribute identified by 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)
Remove the attribute identified by name and return its value. |
void |
setAttribute(String name,
Object value)
Set the attribute defined by name to the supplied value . |
void |
setSource(Object source)
Set the configuration source Object for this metadata element. |
Methods inherited from class org.springframework.core.AttributeAccessorSupport |
---|
attributeNames, copyAttributesFrom, equals, hasAttribute, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanMetadataAttributeAccessor()
Method Detail |
---|
public void setSource(Object source)
Object
for this metadata element.
The exact type of the object will depend on the configuration mechanism used.
public Object getSource()
BeanMetadataElement
Object
for this metadata element
(may be null
).
getSource
in interface BeanMetadataElement
public void addMetadataAttribute(BeanMetadataAttribute attribute)
attribute
- the BeanMetadataAttribute object to registerpublic BeanMetadataAttribute getMetadataAttribute(String name)
name
- the name of the attribute
null
if no such attribute definedpublic void setAttribute(String name, Object value)
AttributeAccessor
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.
setAttribute
in interface AttributeAccessor
setAttribute
in class AttributeAccessorSupport
name
- the unique attribute keyvalue
- the attribute value to be attachedpublic Object getAttribute(String name)
AttributeAccessor
name
.
Return null
if the attribute doesn't exist.
getAttribute
in interface AttributeAccessor
getAttribute
in class AttributeAccessorSupport
name
- the unique attribute key
public Object removeAttribute(String name)
AttributeAccessor
name
and return its value.
Return null
if no attribute under name
is found.
removeAttribute
in interface AttributeAccessor
removeAttribute
in class AttributeAccessorSupport
name
- the unique attribute key
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |