Package org.jboss.jandex
Class MutableAnnotationOverlayImpl
java.lang.Object
org.jboss.jandex.AnnotationOverlayImpl
org.jboss.jandex.MutableAnnotationOverlayImpl
- All Implemented Interfaces:
AnnotationOverlay
,MutableAnnotationOverlay
final class MutableAnnotationOverlayImpl
extends AnnotationOverlayImpl
implements MutableAnnotationOverlay
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.jandex.AnnotationOverlay
AnnotationOverlay.Builder
Nested classes/interfaces inherited from interface org.jboss.jandex.MutableAnnotationOverlay
MutableAnnotationOverlay.Builder
-
Field Summary
FieldsFields inherited from class org.jboss.jandex.AnnotationOverlayImpl
compatibleMode, index, inheritedAnnotations, overlay, runtimeAnnotationsOnly, transformations
-
Constructor Summary
ConstructorsConstructorDescriptionMutableAnnotationOverlayImpl
(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(Declaration declaration, AnnotationInstance annotation) Adds given annotation instance to givendeclaration
.private AnnotationTransformation
addTransformation
(Declaration declaration, AnnotationInstance annotation) freeze()
Freezes this mutable annotation overlay and returns the annotation transformations to create an equivalent immutable annotation overlay.(package private) Collection
<AnnotationInstance> getAnnotationsFor
(Declaration declaration) void
removeAnnotations
(Declaration declaration, Predicate<AnnotationInstance> predicate) Removes all annotations matching givenpredicate
from givendeclaration
.private AnnotationTransformation
removeTransformation
(Declaration declaration, Predicate<AnnotationInstance> predicate) Methods inherited from class org.jboss.jandex.AnnotationOverlayImpl
annotation, annotations, annotationsWithRepeatable, getOriginalAnnotations, hasAnnotation, hasAnyAnnotation, index
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jboss.jandex.AnnotationOverlay
annotation, annotation, annotations, annotationsWithRepeatable, annotationsWithRepeatable, hasAnnotation, hasAnnotation, hasAnyAnnotation, hasAnyAnnotation, index
-
Field Details
-
frozen
private volatile boolean frozen
-
-
Constructor Details
-
MutableAnnotationOverlayImpl
MutableAnnotationOverlayImpl(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations)
-
-
Method Details
-
getAnnotationsFor
- Overrides:
getAnnotationsFor
in classAnnotationOverlayImpl
-
addAnnotation
Description copied from interface:MutableAnnotationOverlay
Adds given annotation instance to givendeclaration
. When asking this annotation overlay about annotation information for given declaration, the results will include given annotation instance.- Specified by:
addAnnotation
in interfaceMutableAnnotationOverlay
- Parameters:
declaration
- the declaration to modify, must not benull
annotation
- the annotation instance to add todeclaration
for, must not benull
-
addTransformation
private AnnotationTransformation addTransformation(Declaration declaration, AnnotationInstance annotation) -
removeAnnotations
Description copied from interface:MutableAnnotationOverlay
Removes all annotations matching givenpredicate
from givendeclaration
. When asking this annotation overlay about annotation information for given declaration, the results will not include matching annotation instances.- Specified by:
removeAnnotations
in interfaceMutableAnnotationOverlay
- Parameters:
declaration
- the declaration to modify, must not benull
predicate
- the annotation predicate, must not benull
-
removeTransformation
private AnnotationTransformation removeTransformation(Declaration declaration, Predicate<AnnotationInstance> predicate) -
freeze
Description copied from interface:MutableAnnotationOverlay
Freezes this mutable annotation overlay and returns the annotation transformations to create an equivalent immutable annotation overlay. After freezing, theMutableAnnotationOverlay.addAnnotation(Declaration, AnnotationInstance)
andMutableAnnotationOverlay.removeAnnotations(Declaration, Predicate)
methods will throw an exception.- Specified by:
freeze
in interfaceMutableAnnotationOverlay
- Returns:
- immutable list of annotation transformations equivalent to mutations performed on this annotation overlay,
never
null
-