Interface AnnotationTargetParentProvider

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean accept​(java.lang.Object target)  
      void cleanup​(Project closedProject)
      Called after project is closed to clean any project specific caches
      java.lang.Object getParent​(java.lang.Object target)
      This method is called each time annotations are requested for any target in AnnotationManager and that happens constantly.
      Project getProject​(java.lang.Object target)
      Project for the custom target is required to clean up the added annotations when the project is closed
    • Method Detail

      • accept

        boolean accept​(java.lang.Object target)
      • getParent

        @CheckForNull
        java.lang.Object getParent​(java.lang.Object target)
        This method is called each time annotations are requested for any target in AnnotationManager and that happens constantly. So implementations of this method should be fast and avoid new object creation.

        It is legal to return the same instance of the parent object for different targets. In fact, core implementations does this - uses the same instance but uses setters to change the object for each call. For that reason the returned parent objects are not and should not be cached/stored. They are only for momentary use and are in a thread safe manner used as key to retrieve annotations from a HashSet.
        Parameters:
        target - annotation target
      • getProject

        @CheckForNull
        Project getProject​(java.lang.Object target)
        Project for the custom target is required to clean up the added annotations when the project is closed
      • cleanup

        void cleanup​(Project closedProject)
        Called after project is closed to clean any project specific caches