|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AttributeAccessor
Interface defining a generic contract for attaching and accessing metadata to/from arbitrary objects.
Method Summary | |
---|---|
java.lang.String[] |
attributeNames()
Return the names of all attributes. |
java.lang.Object |
getAttribute(java.lang.String name)
Get the value of the attribute identified by name . |
boolean |
hasAttribute(java.lang.String name)
Return true if the attribute identified by name exists. |
java.lang.Object |
removeAttribute(java.lang.String name)
Remove the attribute identified by name and return its value. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set the attribute defined by name to the supplied value . |
Method Detail |
---|
void setAttribute(java.lang.String name, java.lang.Object value)
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.
name
- the unique attribute keyvalue
- the attribute value to be attachedjava.lang.Object getAttribute(java.lang.String name)
name
.
Return null
if the attribute doesn't exist.
name
- the unique attribute key
java.lang.Object removeAttribute(java.lang.String name)
name
and return its value.
Return null
if no attribute under name
is found.
name
- the unique attribute key
boolean hasAttribute(java.lang.String name)
true
if the attribute identified by name
exists.
Otherwise return false
.
name
- the unique attribute keyjava.lang.String[] attributeNames()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |