/** * Interface defining a generic contract for attaching and accessing metadata * to/from arbitrary objects. *定义用于附加和访问元数据的通用的接口,来自任意对象 * @author Rob Harrop * @since 2.0 */ public interface AttributeAccessor { /** * Set the attribute defined by {@code name} to the supplied {@code value}. 将name的属性值设置为value*/ void setAttribute(String name, Object value); /** * Get the value of the attribute identified by {@code name}. * Return {@code null} if the attribute doesn't exist. 获取name的属性值,如果该属性不存在,则返回Null*/ Object getAttribute(String name); /** * Remove the attribute identified by {@code name} and return its value. * Return {@code null} if no attribute under {@code name} is found. 删除name的属性值,如果找不到Nmae属性的值则返回Null*/ Object removeAttribute(String name); /** * Return {@code true} if the attribute identified by {@code name} exists. 如果name属性值存在则返回true,否者返回false*/ boolean hasAttribute(String name); /** * Return the names of all attributes.
返回所有的属性名称 */ String[] attributeNames(); }