Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.introspect

public final Class AnnotationMap

extends Object
implements Annotations
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.util.Annotations
Imports
java.lang.annotation.Annotation, java.util.*, com.fasterxml.jackson.databind.util.Annotations

Simple helper class used to keep track of collection of Jackson Annotations associated with annotatable things (methods, constructors, classes). Note that only Jackson-owned annotations are tracked (for now?).

Field Summary

Modifier and TypeField and Description
protected HashMap<Class<?>, Annotation>

Constructor Summary

AccessConstructor and Description
public
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected final boolean
public boolean

Returns:

True if the addition changed the contents, that is, this map did not already have specified annotation
add
(Annotation ann)

Method called to add specified annotation in the Map.

public boolean
addIfNotPresent(Annotation ann)

Method called to add specified annotation in the Map, but only if it didn't yet exist.

public Iterable<Annotation>
public <A extends Annotation> A
get(Class<A> cls)

Implements com.fasterxml.jackson.databind.util.Annotations.get.

Main access method used to find value for given annotation.

public boolean
public boolean
hasOneOf(Class<? extends Annotation>[] annoClasses)

Implements com.fasterxml.jackson.databind.util.Annotations.hasOneOf.

Helper method that can be used for a "bulk" check to see if at least one of given annotation types is included within this map.

public static AnnotationMap
merge(AnnotationMap primary, AnnotationMap secondary)

public static AnnotationMap
of(Class<?> type, Annotation value)

public int
size()

Implements com.fasterxml.jackson.databind.util.Annotations.size.

Returns number of annotation entries in this collection.

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 HashMap<Class<?>, Annotation> _annotations

Constructor Detail

AnnotationMapback to summary
public AnnotationMap()
AnnotationMapback to summary
pack-priv AnnotationMap(HashMap<Class<?>, Annotation> a)

Method Detail

_addback to summary
protected final boolean _add(Annotation ann)
addback to summary
public boolean add(Annotation ann)

Method called to add specified annotation in the Map.

Returns:boolean

True if the addition changed the contents, that is, this map did not already have specified annotation

addIfNotPresentback to summary
public boolean addIfNotPresent(Annotation ann)

Method called to add specified annotation in the Map, but only if it didn't yet exist.

annotationsback to summary
public Iterable<Annotation> annotations()
Since
2.3
getback to summary
public <A extends Annotation> A get(Class<A> cls)

Implements com.fasterxml.jackson.databind.util.Annotations.get.

Doc from com.fasterxml.jackson.databind.util.Annotations.get.

Main access method used to find value for given annotation.

Annotations
@SuppressWarnings:unchecked
@Override
hasback to summary
public boolean has(Class<?> cls)

Implements com.fasterxml.jackson.databind.util.Annotations.has.

Annotations
@Override
hasOneOfback to summary
public boolean hasOneOf(Class<? extends Annotation>[] annoClasses)

Implements com.fasterxml.jackson.databind.util.Annotations.hasOneOf.

Helper method that can be used for a "bulk" check to see if at least one of given annotation types is included within this map.

Annotations
@Override
Since
2.7
mergeback to summary
public static AnnotationMap merge(AnnotationMap primary, AnnotationMap secondary)
ofback to summary
public static AnnotationMap of(Class<?> type, Annotation value)
sizeback to summary
public int size()

Implements com.fasterxml.jackson.databind.util.Annotations.size.

Doc from com.fasterxml.jackson.databind.util.Annotations.size.

Returns number of annotation entries in this collection.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override