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 booleanfrozen-
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 voidaddAnnotation(Declaration declaration, AnnotationInstance annotation)Adds given annotation instance to givendeclaration.private AnnotationTransformationaddTransformation(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.Collection<AnnotationInstance>getAnnotationsFor(Declaration declaration)voidremoveAnnotations(Declaration declaration, java.util.function.Predicate<AnnotationInstance> predicate)Removes all annotations matching givenpredicatefrom givendeclaration.private AnnotationTransformationremoveTransformation(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.Collection<AnnotationInstance> getAnnotationsFor(Declaration declaration)
- Overrides:
getAnnotationsForin classAnnotationOverlayImpl
-
addAnnotation
public void addAnnotation(Declaration declaration, AnnotationInstance annotation)
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
public void removeAnnotations(Declaration declaration, java.util.function.Predicate<AnnotationInstance> predicate)
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, java.util.function.Predicate<AnnotationInstance> predicate)
-
freeze
public java.util.List<AnnotationTransformation> 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
-
-