Package com.sun.codemodel
Interface JAnnotatable
- All Known Implementing Classes:
JAnnotationArrayMember,JDefinedClass,JEnumConstant,JFieldVar,JMethod,JPackage,JVar
public interface JAnnotatable
Annotatable program elements.
- Author:
- Kohsuke Kawaguchi
-
Method Summary
Modifier and TypeMethodDescriptionAdds an annotation to this program element.annotate(Class<? extends Annotation> clazz) Adds an annotation to this program element.<W extends JAnnotationWriter<? extends Annotation>>
WAdds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.Read-only live view of all annotations on thisJAnnotatablebooleanremoveAnnotation(JAnnotationUse annotation) Removes annotation from this program element.
-
Method Details
-
annotate
Adds an annotation to this program element.- Parameters:
clazz- The annotation class to annotate the program element with
-
annotate
Adds an annotation to this program element.- Parameters:
clazz- The annotation class to annotate the program element with
-
removeAnnotation
Removes annotation from this program element.- Parameters:
annotation- The annotation to be removed from the program element
-
annotate2
Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.- Type Parameters:
W-- Parameters:
clazz-- Returns:
-
annotations
Collection<JAnnotationUse> annotations()Read-only live view of all annotations on thisJAnnotatable- Returns:
- Can be empty but never null.
-