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.BuilderNested 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 TypeMethodDescriptionvoidaddAnnotation(Declaration declaration, AnnotationInstance annotation) Adds given annotation instance to givendeclaration.private AnnotationTransformationaddTransformation(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) voidremoveAnnotations(Declaration declaration, Predicate<AnnotationInstance> predicate) Removes all annotations matching givenpredicatefrom givendeclaration.private AnnotationTransformationremoveTransformation(Declaration declaration, Predicate<AnnotationInstance> predicate) Methods inherited from class org.jboss.jandex.AnnotationOverlayImpl
annotation, annotations, annotationsWithRepeatable, getOriginalAnnotations, hasAnnotation, hasAnyAnnotation, indexMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getAnnotationsForin classAnnotationOverlayImpl
-
addAnnotation
Description copied from interface:MutableAnnotationOverlayAdds 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:
addAnnotationin interfaceMutableAnnotationOverlay- Parameters:
declaration- the declaration to modify, must not benullannotation- the annotation instance to add todeclarationfor, must not benull
-
addTransformation
private AnnotationTransformation addTransformation(Declaration declaration, AnnotationInstance annotation) -
removeAnnotations
Description copied from interface:MutableAnnotationOverlayRemoves all annotations matching givenpredicatefrom givendeclaration. When asking this annotation overlay about annotation information for given declaration, the results will not include matching annotation instances.- Specified by:
removeAnnotationsin interfaceMutableAnnotationOverlay- Parameters:
declaration- the declaration to modify, must not benullpredicate- the annotation predicate, must not benull
-
removeTransformation
private AnnotationTransformation removeTransformation(Declaration declaration, Predicate<AnnotationInstance> predicate) -
freeze
Description copied from interface:MutableAnnotationOverlayFreezes 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:
freezein interfaceMutableAnnotationOverlay- Returns:
- immutable list of annotation transformations equivalent to mutations performed on this annotation overlay,
never
null
-