类 BeanMetadataAttributeAccessor
- java.lang.Object
- org.springframework.core.AttributeAccessorSupport
- org.springframework.beans.BeanMetadataAttributeAccessor
- 所有已实现的接口:
Serializable
,BeanMetadataElement
,AttributeAccessor
public class BeanMetadataAttributeAccessor extends AttributeAccessorSupport implements BeanMetadataElement
Extension ofAttributeAccessorSupport
, holding attributes asBeanMetadataAttribute
objects in order to keep track of the definition source.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 BeanMetadataAttributeAccessor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 byname
.BeanMetadataAttribute
getMetadataAttribute(String name)
Look up the given BeanMetadataAttribute in this accessor's set of attributes.Object
getSource()
Return the configuration sourceObject
for this metadata element (may benull
).Object
removeAttribute(String name)
Remove the attribute identified byname
and return its value.void
setAttribute(String name, Object value)
Set the attribute defined byname
to the suppliedvalue
.void
setSource(Object source)
Set the configuration sourceObject
for this metadata element.从类继承的方法 org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, equals, hasAttribute, hashCode
构造器详细资料
BeanMetadataAttributeAccessor
public BeanMetadataAttributeAccessor()
方法详细资料
setSource
public void setSource(Object source)
Set the configuration sourceObject
for this metadata element.The exact type of the object will depend on the configuration mechanism used.
getSource
public Object getSource()
从接口复制的说明:BeanMetadataElement
Return the configuration sourceObject
for this metadata element (may benull
).- 指定者:
getSource
在接口中BeanMetadataElement
addMetadataAttribute
public void addMetadataAttribute(BeanMetadataAttribute attribute)
Add the given BeanMetadataAttribute to this accessor's set of attributes.- 参数:
attribute
- the BeanMetadataAttribute object to register
getMetadataAttribute
public BeanMetadataAttribute getMetadataAttribute(String name)
Look up the given BeanMetadataAttribute in this accessor's set of attributes.- 参数:
name
- the name of the attribute- 返回:
- the corresponding BeanMetadataAttribute object, or
null
if no such attribute defined
setAttribute
public void setAttribute(String name, Object value)
从接口复制的说明:AttributeAccessor
Set the attribute defined byname
to the suppliedvalue
. Ifvalue
isnull
, the attribute isremoved
.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
在接口中AttributeAccessor
- 覆盖:
setAttribute
在类中AttributeAccessorSupport
- 参数:
name
- the unique attribute keyvalue
- the attribute value to be attached
getAttribute
public Object getAttribute(String name)
从接口复制的说明:AttributeAccessor
Get the value of the attribute identified byname
. Returnnull
if the attribute doesn't exist.- 指定者:
getAttribute
在接口中AttributeAccessor
- 覆盖:
getAttribute
在类中AttributeAccessorSupport
- 参数:
name
- the unique attribute key- 返回:
- the current value of the attribute, if any
removeAttribute
public Object removeAttribute(String name)
从接口复制的说明:AttributeAccessor
Remove the attribute identified byname
and return its value. Returnnull
if no attribute undername
is found.- 指定者:
removeAttribute
在接口中AttributeAccessor
- 覆盖:
removeAttribute
在类中AttributeAccessorSupport
- 参数:
name
- the unique attribute key- 返回:
- the last value of the attribute, if any