Package org.jboss.jandex
Interface AnnotationTransformation.TransformationContext
-
- All Known Implementing Classes:
AnnotationOverlayImpl.TransformationContextImpl
- Enclosing interface:
- AnnotationTransformation
public static interface AnnotationTransformation.TransformationContextA transformation context. Passed as a singular parameter toAnnotationTransformation.apply(TransformationContext).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)Adds an annotation of givenannotationClassto the current set of annotations.voidadd(AnnotationInstance annotation)Adds theannotationto the current set of annotations.voidaddAll(java.util.Collection<AnnotationInstance> annotations)Adds allannotationsto the current set of annotations.voidaddAll(AnnotationInstance... annotations)Adds allannotationsto the current set of annotations.java.util.Collection<AnnotationInstance>annotations()Returns the collection of annotations present on the declaration that is being transformed.Declarationdeclaration()Returns the declaration that is being transformed.booleanhasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)Returns whether the current set of annotations contains an annotation of givenannotationClass.booleanhasAnnotation(java.util.function.Predicate<AnnotationInstance> predicate)Returns whether the current set of annotations contains an annotation that matches givenpredicate.booleanhasAnnotation(DotName annotationName)Returns whether the current set of annotations contains an annotation whose class has givenannotationName.voidremove(java.util.function.Predicate<AnnotationInstance> predicate)Removes annotations that match givenpredicatefrom the current set of annotations.voidremoveAll()Removes all annotations from current set of annotations.
-
-
-
Method Detail
-
declaration
Declaration declaration()
Returns the declaration that is being transformed.- Returns:
- the declaration that is being transformed
-
annotations
java.util.Collection<AnnotationInstance> annotations()
Returns the collection of annotations present on the declaration that is being transformed. Reflects all changes done by this annotation transformation and all annotation transformations executed prior to this one.Changes made directly to this collection and changes made through the other
TransformationContextmethods are interchangeable.- Returns:
- the collection of annotations present on the declaration that is being transformed
-
hasAnnotation
boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Returns whether the current set of annotations contains an annotation of givenannotationClass.- Parameters:
annotationClass- the annotation class, must not benull- Returns:
- whether the current set of annotations contains an annotation of given class
-
hasAnnotation
boolean hasAnnotation(DotName annotationName)
Returns whether the current set of annotations contains an annotation whose class has givenannotationName.- Parameters:
annotationName- name of the annotation class, must not benull- Returns:
- whether the current set of annotations contains an annotation of given class
-
hasAnnotation
boolean hasAnnotation(java.util.function.Predicate<AnnotationInstance> predicate)
Returns whether the current set of annotations contains an annotation that matches givenpredicate.- Parameters:
predicate- the predicate, must not benull- Returns:
- whether the current set of annotations contains an annotation of given class
-
add
void add(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Adds an annotation of givenannotationClassto the current set of annotations.The annotation type must have no members.
- Parameters:
annotationClass- the class of annotation to add, must not benull
-
add
void add(AnnotationInstance annotation)
Adds theannotationto the current set of annotations.- Parameters:
annotation- the annotation to add, must not benull
-
addAll
void addAll(AnnotationInstance... annotations)
Adds allannotationsto the current set of annotations.- Parameters:
annotations- the annotations to add, must not benull
-
addAll
void addAll(java.util.Collection<AnnotationInstance> annotations)
Adds allannotationsto the current set of annotations.- Parameters:
annotations- the annotations to add, must not benull
-
remove
void remove(java.util.function.Predicate<AnnotationInstance> predicate)
Removes annotations that match givenpredicatefrom the current set of annotations.- Parameters:
predicate- the annotation predicate, must not benull
-
removeAll
void removeAll()
Removes all annotations from current set of annotations.
-
-