1 package com.fasterxml.jackson.databind.util; 2 3 import java.lang.annotation.Annotation; 4 5 /** 6 * Interface that defines interface for accessing contents of a 7 * collection of annotations. This is needed when introspecting 8 * annotation-based features from different kinds of things, not 9 * just objects that Java Reflection interface exposes. 10 *<p> 11 * Standard mutable implementation is {@link com.fasterxml.jackson.databind.introspect.AnnotationMap} 12 */ 13 public interface Annotations 14 { 15 /** 16 * Main access method used to find value for given annotation. 17 */ get(Class<A> cls)18 public <A extends Annotation> A get(Class<A> cls); 19 20 /** 21 * @since 2.9 22 */ has(Class<?> cls)23 public boolean has(Class<?> cls); 24 25 /** 26 * @since 2.9 27 */ hasOneOf(Class<? extends Annotation>[] annoClasses)28 public boolean hasOneOf(Class<? extends Annotation>[] annoClasses); 29 30 /** 31 * Returns number of annotation entries in this collection. 32 */ size()33 public int size(); 34 } 35