Package com.fasterxml.classmate
Class Annotations
- java.lang.Object
-
- com.fasterxml.classmate.Annotations
-
- All Implemented Interfaces:
Serializable
,Iterable<Annotation>
public class Annotations extends Object implements Serializable, Iterable<Annotation>
Container class used for storing set of annotations resolved for types (classes) as members (methods, fields, constructors).- Author:
- tatu
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkedHashMap<Class<? extends Annotation>,Annotation>
_annotations
-
Constructor Summary
Constructors Constructor Description Annotations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Annotation override)
Method for adding specified annotation, overriding existing value for the annotation type.void
addAll(Annotations overrides)
Method for adding all annotations from specified set, as overrides to annotations this set hasvoid
addAsDefault(Annotation defValue)
Method for adding specified annotation if and only if no value exists for the annotation type.Annotation[]
asArray()
List<Annotation>
asList()
<A extends Annotation>
Aget(Class<A> cls)
Iterator<Annotation>
iterator()
int
size()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
_annotations
protected LinkedHashMap<Class<? extends Annotation>,Annotation> _annotations
-
-
Method Detail
-
add
public void add(Annotation override)
Method for adding specified annotation, overriding existing value for the annotation type.
-
addAll
public void addAll(Annotations overrides)
Method for adding all annotations from specified set, as overrides to annotations this set has
-
addAsDefault
public void addAsDefault(Annotation defValue)
Method for adding specified annotation if and only if no value exists for the annotation type.
-
iterator
public Iterator<Annotation> iterator()
- Specified by:
iterator
in interfaceIterable<Annotation>
-
size
public int size()
-
get
public <A extends Annotation> A get(Class<A> cls)
-
asArray
public Annotation[] asArray()
- Since:
- 1.1.1
-
asList
public List<Annotation> asList()
- Since:
- 1.1.1
-
-