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
Fields Modifier and Type Field Description private boolean
frozen
-
Fields inherited from class org.jboss.jandex.AnnotationOverlayImpl
compatibleMode, index, inheritedAnnotations, overlay, runtimeAnnotationsOnly, transformations
-
-
Constructor Summary
Constructors Constructor Description MutableAnnotationOverlayImpl(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(Declaration declaration, AnnotationInstance annotation)
Adds given annotation instance to givendeclaration
.private AnnotationTransformation
addTransformation(Declaration declaration, AnnotationInstance annotation)
java.util.List<AnnotationTransformation>
freeze()
Freezes this mutable annotation overlay and returns the annotation transformations to create an equivalent immutable annotation overlay.(package private) java.util.Set<AnnotationInstance>
getAnnotationsFor(Declaration declaration)
void
removeAnnotations(Declaration declaration, java.util.function.Predicate<AnnotationInstance> predicate)
Removes all annotations matching givenpredicate
from givendeclaration
.private AnnotationTransformation
removeTransformation(Declaration declaration, java.util.function.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
-
-
-
-
Constructor Detail
-
MutableAnnotationOverlayImpl
MutableAnnotationOverlayImpl(IndexView index, boolean compatibleMode, boolean runtimeAnnotationsOnly, boolean inheritedAnnotations)
-
-
Method Detail
-
getAnnotationsFor
java.util.Set<AnnotationInstance> getAnnotationsFor(Declaration declaration)
- Overrides:
getAnnotationsFor
in classAnnotationOverlayImpl
-
addAnnotation
public void addAnnotation(Declaration declaration, AnnotationInstance annotation)
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
public void removeAnnotations(Declaration declaration, java.util.function.Predicate<AnnotationInstance> predicate)
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, java.util.function.Predicate<AnnotationInstance> predicate)
-
freeze
public java.util.List<AnnotationTransformation> 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
-
-