类 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 asBeanMetadataAttributeobjects in order to keep track of the definition source.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 BeanMetadataAttributeAccessor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddMetadataAttribute(BeanMetadataAttribute attribute)Add the given BeanMetadataAttribute to this accessor's set of attributes.ObjectgetAttribute(String name)Get the value of the attribute identified byname.BeanMetadataAttributegetMetadataAttribute(String name)Look up the given BeanMetadataAttribute in this accessor's set of attributes.ObjectgetSource()Return the configuration sourceObjectfor this metadata element (may benull).ObjectremoveAttribute(String name)Remove the attribute identified bynameand return its value.voidsetAttribute(String name, Object value)Set the attribute defined bynameto the suppliedvalue.voidsetSource(Object source)Set the configuration sourceObjectfor this metadata element.从类继承的方法 org.springframework.core.AttributeAccessorSupport
attributeNames, copyAttributesFrom, equals, hasAttribute, hashCode
构造器详细资料
BeanMetadataAttributeAccessor
public BeanMetadataAttributeAccessor()
方法详细资料
setSource
public void setSource(@Nullable Object source)
Set the configuration sourceObjectfor this metadata element.The exact type of the object will depend on the configuration mechanism used.
getSource
@Nullable public Object getSource()
从接口复制的说明:BeanMetadataElementReturn the configuration sourceObjectfor 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
@Nullable 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
nullif no such attribute defined
setAttribute
public void setAttribute(String name, @Nullable Object value)
从接口复制的说明:AttributeAccessorSet the attribute defined bynameto the suppliedvalue. Ifvalueisnull, 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
@Nullable public Object getAttribute(String name)
从接口复制的说明:AttributeAccessorGet the value of the attribute identified byname. Returnnullif the attribute doesn't exist.- 指定者:
getAttribute在接口中AttributeAccessor- 覆盖:
getAttribute在类中AttributeAccessorSupport- 参数:
name- the unique attribute key- 返回:
- the current value of the attribute, if any
removeAttribute
@Nullable public Object removeAttribute(String name)
从接口复制的说明:AttributeAccessorRemove the attribute identified bynameand return its value. Returnnullif no attribute undernameis found.- 指定者:
removeAttribute在接口中AttributeAccessor- 覆盖:
removeAttribute在类中AttributeAccessorSupport- 参数:
name- the unique attribute key- 返回:
- the last value of the attribute, if any