类 AttributeAccessorSupport
- java.lang.Object
- org.springframework.core.AttributeAccessorSupport
- 所有已实现的接口:
Serializable
,AttributeAccessor
public abstract class AttributeAccessorSupport extends Object implements AttributeAccessor, Serializable
Support class forAttributeAccessors
, providing a base implementation of all methods. To be extended by subclasses.Serializable
if subclasses and all attribute values areSerializable
.- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop, Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 AttributeAccessorSupport()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String[]
attributeNames()
Return the names of all attributes.protected void
copyAttributesFrom(AttributeAccessor source)
Copy the attributes from the supplied AttributeAccessor to this accessor.boolean
equals(Object other)
Object
getAttribute(String name)
Get the value of the attribute identified byname
.boolean
hasAttribute(String name)
Returntrue
if the attribute identified byname
exists.int
hashCode()
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
.
构造器详细资料
AttributeAccessorSupport
public AttributeAccessorSupport()
方法详细资料
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
- 参数:
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
- 参数:
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
- 参数:
name
- the unique attribute key- 返回:
- the last value of the attribute, if any
hasAttribute
public boolean hasAttribute(String name)
从接口复制的说明:AttributeAccessor
Returntrue
if the attribute identified byname
exists. Otherwise returnfalse
.- 指定者:
hasAttribute
在接口中AttributeAccessor
- 参数:
name
- the unique attribute key
attributeNames
public String[] attributeNames()
从接口复制的说明:AttributeAccessor
Return the names of all attributes.- 指定者:
attributeNames
在接口中AttributeAccessor
copyAttributesFrom
protected void copyAttributesFrom(AttributeAccessor source)
Copy the attributes from the supplied AttributeAccessor to this accessor.- 参数:
source
- the AttributeAccessor to copy from