|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Annotation
Describes an interface for Annotating objects. Annotatable Objects can store other Objects indexed by arbitrary keys and return them on demand. This is similar in concept to the Preferences system, except that values can be keyed to arbitrary objects instead of just strings.
| Nested Class Summary | |
|---|---|
static class |
Annotation.AnnotationNotFoundException
This exception indicates that the requested annotation was not present on this object. |
| Method Summary | |
|---|---|
java.lang.Object |
getAnnotation(java.lang.Object key)
Returns the annotation keyed to the passed-in Object. |
java.lang.Object |
removeAnnotation(java.lang.Object key)
Removes and returns the annotation keyed to the passed-in Object. |
void |
setAnnotation(java.lang.Object key,
java.lang.Object data)
Sets an annotation to hold an Object, keyed to the given key Object. |
| Method Detail |
|---|
void setAnnotation(java.lang.Object key,
java.lang.Object data)
key - The key to use for this Object.data - The data to store.
java.lang.Object getAnnotation(java.lang.Object key)
throws Annotation.AnnotationNotFoundException
key - The key to search for.
Annotation.AnnotationNotFoundException - If no object is found for the key.
java.lang.Object removeAnnotation(java.lang.Object key)
throws Annotation.AnnotationNotFoundException
key - The key to search for.
Annotation.AnnotationNotFoundException - If no object is found for the key.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||