public interface NodeWithAnnotations<T>
Modifier and Type | Method and Description |
---|---|
default NormalAnnotationExpr |
addAnnotation(Class<? extends Annotation> clazz)
Annotates this and automatically add the import
|
default NormalAnnotationExpr |
addAnnotation(String name)
Annotates this
|
default T |
addMarkerAnnotation(Class<? extends Annotation> clazz)
Annotates this with a marker annotation and automatically add the import
|
default T |
addMarkerAnnotation(String name)
Annotates this with a marker annotation
|
default T |
addSingleMemberAnnotation(Class<? extends Annotation> clazz,
String value)
Annotates this with a single member annotation and automatically add the import
|
default T |
addSingleMemberAnnotation(String name,
String value)
Annotates this with a single member annotation
|
default AnnotationExpr |
getAnnotationByClass(Class<? extends Annotation> annotationClass)
Try to find an annotation by its class
|
default AnnotationExpr |
getAnnotationByName(String annotationName)
Try to find an annotation by its name
|
List<AnnotationExpr> |
getAnnotations() |
default boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Check whether an annotation with this class is present on this element
|
default boolean |
isAnnotationPresent(String annotationName)
Check whether an annotation with this name is present on this element
|
T |
setAnnotations(List<AnnotationExpr> annotations) |
List<AnnotationExpr> getAnnotations()
T setAnnotations(List<AnnotationExpr> annotations)
default NormalAnnotationExpr addAnnotation(String name)
name
- the name of the annotationNormalAnnotationExpr
addeddefault NormalAnnotationExpr addAnnotation(Class<? extends Annotation> clazz)
clazz
- the class of the annotationNormalAnnotationExpr
addeddefault T addMarkerAnnotation(String name)
name
- the name of the annotationdefault T addMarkerAnnotation(Class<? extends Annotation> clazz)
clazz
- the class of the annotationdefault T addSingleMemberAnnotation(String name, String value)
name
- the name of the annotationdefault T addSingleMemberAnnotation(Class<? extends Annotation> clazz, String value)
clazz
- the class of the annotationdefault boolean isAnnotationPresent(String annotationName)
annotationName
- the name of the annotationdefault boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
annotationClass
- the class of the annotationdefault AnnotationExpr getAnnotationByName(String annotationName)
annotationName
- the name of the annotationdefault AnnotationExpr getAnnotationByClass(Class<? extends Annotation> annotationClass)
annotationClass
- the class of the annotationCopyright © 2007–2016. All rights reserved.