Interface MutableAnnotationOverlay

    • Method Detail

      • builder

        static MutableAnnotationOverlay.Builder builder​(IndexView index)
        Returns a new builder for a mutable annotation overlay for given index.

        Thread safety

        The object returned by the builder is not thread safe and should be confined to a single thread. After calling freeze(), the object becomes immutable and can be shared between threads.

        Parameters:
        index - the Jandex index, must not be null
        Returns:
        the mutable annotation overlay builder, never null
      • addAnnotation

        void addAnnotation​(Declaration declaration,
                           AnnotationInstance annotation)
        Adds given annotation instance to given declaration. When asking this annotation overlay about annotation information for given declaration, the results will include given annotation instance.
        Parameters:
        declaration - the declaration to modify, must not be null
        annotation - the annotation instance to add to declaration for, must not be null
      • removeAnnotations

        void removeAnnotations​(Declaration declaration,
                               java.util.function.Predicate<AnnotationInstance> predicate)
        Removes all annotations matching given predicate from given declaration. When asking this annotation overlay about annotation information for given declaration, the results will not include matching annotation instances.
        Parameters:
        declaration - the declaration to modify, must not be null
        predicate - the annotation predicate, must not be null