Top Description Fields Constructors Methods
com.fasterxml.classmate

public Class Annotations

extends Object
implements Serializable, Iterable<Annotation>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable, java.io.Serializable
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, java.lang.annotation.Annotation, java.util.*

Container class used for storing set of annotations resolved for types (classes) as members (methods, fields, constructors).
Author
tatu

Field Summary

Modifier and TypeField and Description
protected LinkedHashMap<Class<? extends Annotation>, Annotation>
private final Annotation[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(Annotation override)

Method for adding specified annotation, overriding existing value for the annotation type.

public void
addAll(Annotations overrides)

Method for adding all annotations from specified set, as overrides to annotations this set has

public void
addAsDefault(Annotation defValue)

Method for adding specified annotation if and only if no value exists for the annotation type.

public Annotation[]
public List<Annotation>
public <A extends Annotation> A
get(Class<A> cls)

public Iterator<Annotation>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.
public int
size()

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_annotationsback to summary
protected LinkedHashMap<Class<? extends Annotation>, Annotation> _annotations
NO_ANNOTATIONSback to summary
private final Annotation[] NO_ANNOTATIONS

Constructor Detail

Annotationsback to summary
public Annotations()

Method Detail

addback to summary
public void add(Annotation override)

Method for adding specified annotation, overriding existing value for the annotation type.

addAllback to summary
public void addAll(Annotations overrides)

Method for adding all annotations from specified set, as overrides to annotations this set has

addAsDefaultback to summary
public void addAsDefault(Annotation defValue)

Method for adding specified annotation if and only if no value exists for the annotation type.

asArrayback to summary
public Annotation[] asArray()
Since
1.1.1
asListback to summary
public List<Annotation> asList()
Since
1.1.1
getback to summary
public <A extends Annotation> A get(Class<A> cls)
Annotations
@SuppressWarnings:unchecked
iteratorback to summary
public Iterator<Annotation> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Annotation>

an Iterator.

Annotations
@Override
sizeback to summary
public int size()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override