Class AnnotationMap

  • All Implemented Interfaces:
    Annotations

    public final class AnnotationMap
    extends java.lang.Object
    implements 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

      Fields 
      Modifier and Type Field Description
      protected java.util.HashMap<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> _annotations  
    • Constructor Summary

      Constructors 
      Constructor Description
      AnnotationMap()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void _add​(java.lang.annotation.Annotation ann)  
      void add​(java.lang.annotation.Annotation ann)
      Method called to add specified annotation in the Map.
      void addIfNotPresent​(java.lang.annotation.Annotation ann)
      Method called to add specified annotation in the Map, but only if it didn't yet exist.
      <A extends java.lang.annotation.Annotation>
      A
      get​(java.lang.Class<A> cls)
      Main access method used to find value for given annotation.
      static AnnotationMap merge​(AnnotationMap primary, AnnotationMap secondary)  
      int size()
      Returns number of annotation entries in this collection.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _annotations

        protected java.util.HashMap<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> _annotations
    • Constructor Detail

      • AnnotationMap

        public AnnotationMap()
    • Method Detail

      • get

        public <A extends java.lang.annotation.Annotation> A get​(java.lang.Class<A> cls)
        Description copied from interface: Annotations
        Main access method used to find value for given annotation.
        Specified by:
        get in interface Annotations
      • size

        public int size()
        Description copied from interface: Annotations
        Returns number of annotation entries in this collection.
        Specified by:
        size in interface Annotations
      • addIfNotPresent

        public void addIfNotPresent​(java.lang.annotation.Annotation ann)
        Method called to add specified annotation in the Map, but only if it didn't yet exist.
      • add

        public void add​(java.lang.annotation.Annotation ann)
        Method called to add specified annotation in the Map.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • _add

        protected final void _add​(java.lang.annotation.Annotation ann)