JAnnotationArrayMember
, JDefinedClass
, JEnumConstant
, JFieldVar
, JMethod
, JPackage
, JVar
public interface JAnnotatable
Modifier and Type | Method | Description |
---|---|---|
JAnnotationUse |
annotate(JClass clazz) |
Adds an annotation to this program element.
|
JAnnotationUse |
annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz) |
Adds an annotation to this program element.
|
<W extends JAnnotationWriter> |
annotate2(java.lang.Class<W> clazz) |
Adds an annotation to this program element
and returns a type-safe writer to fill in the values of such annotations.
|
java.util.Collection<JAnnotationUse> |
annotations() |
Read-only live view of all annotations on this
JAnnotatable |
boolean |
removeAnnotation(JAnnotationUse annotation) |
Removes annotation from this program element.
|
JAnnotationUse annotate(JClass clazz)
clazz
- The annotation class to annotate the program element withJAnnotationUse annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
clazz
- The annotation class to annotate the program element withboolean removeAnnotation(JAnnotationUse annotation)
annotation
- The annotation to be removed from the program element<W extends JAnnotationWriter> W annotate2(java.lang.Class<W> clazz)
java.util.Collection<JAnnotationUse> annotations()
JAnnotatable
Copyright © 2018 Oracle Corporation. All rights reserved.