Package com.fasterxml.classmate
Class Annotations
- java.lang.Object
-
- com.fasterxml.classmate.Annotations
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<java.lang.annotation.Annotation>
public class Annotations extends java.lang.Object implements java.io.Serializable, java.lang.Iterable<java.lang.annotation.Annotation>Container class used for storing set of annotations resolved for types (classes) as members (methods, fields, constructors).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.LinkedHashMap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation>_annotationsprivate java.lang.annotation.Annotation[]NO_ANNOTATIONS
-
Constructor Summary
Constructors Constructor Description Annotations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.annotation.Annotation override)Method for adding specified annotation, overriding existing value for the annotation type.voidaddAll(Annotations overrides)Method for adding all annotations from specified set, as overrides to annotations this set hasvoidaddAsDefault(java.lang.annotation.Annotation defValue)Method for adding specified annotation if and only if no value exists for the annotation type.java.lang.annotation.Annotation[]asArray()java.util.List<java.lang.annotation.Annotation>asList()<A extends java.lang.annotation.Annotation>
Aget(java.lang.Class<A> cls)java.util.Iterator<java.lang.annotation.Annotation>iterator()intsize()java.lang.StringtoString()
-
-
-
Method Detail
-
add
public void add(java.lang.annotation.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(java.lang.annotation.Annotation defValue)
Method for adding specified annotation if and only if no value exists for the annotation type.
-
iterator
public java.util.Iterator<java.lang.annotation.Annotation> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.annotation.Annotation>
-
size
public int size()
-
get
public <A extends java.lang.annotation.Annotation> A get(java.lang.Class<A> cls)
-
asArray
public java.lang.annotation.Annotation[] asArray()
- Since:
- 1.1.1
-
asList
public java.util.List<java.lang.annotation.Annotation> asList()
- Since:
- 1.1.1
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-