public class Annotations extends Object implements Iterable<IAnnotation>
| Constructor and Description |
|---|
Annotations()
Creates a new Annotations object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all the annotations in this object.
|
Annotations |
clone()
Clones this Annotations object.
|
<A extends IAnnotation> |
get(Class<A> annotationType)
Gets the annotation for a given type.
|
Set<Class<? extends IAnnotation>> |
getAnnotationsTypes() |
boolean |
isEmpty() |
Iterator<IAnnotation> |
iterator() |
<A extends IAnnotation> |
remove(Class<A> annotationType)
Removes the annotation of a given type.
|
<T extends IAnnotation> |
set(T annotation)
Sets an annotation.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic <T extends IAnnotation> void set(T annotation)
T - the annotation type.annotation - The annotation object to set.public <A extends IAnnotation> A get(Class<A> annotationType)
A - the annotation typeannotationType - Type of the annotation to retrieve.public void clear()
public <A extends IAnnotation> A remove(Class<A> annotationType)
A - the annotation typeannotationType - Type of the annotation to remove.public Annotations clone()
Important: the annotations themselves are not cloned, only the map holding them is new.
public Iterator<IAnnotation> iterator()
iterator in interface Iterable<IAnnotation>public Set<Class<? extends IAnnotation>> getAnnotationsTypes()
public boolean isEmpty()
Copyright © 2022. All rights reserved.