public interface JavaAnnotation extends JavaSource<JavaAnnotation>
Annotation source file as an in-memory modifiable
element. See JavaParser for various options in generating
JavaAnnotation instances.| Modifier and Type | Method and Description |
|---|---|
AnnotationElement |
addAnnotationElement()
Add a new Java
AnnotationElement to this JavaAnnotation instance. |
AnnotationElement |
addAnnotationElement(String declaration)
Add a new
AnnotationElement declaration to this JavaAnnotation instance, using the given
String as the declaration. |
AnnotationElement |
getAnnotationElement(String name)
Get the
AnnotationElement with the given name and return it, otherwise, return null. |
List<AnnotationElement> |
getAnnotationElements()
Get a list of all
AnnotationElements declared by this JavaAnnotation, or return an empty list if
no AnnotationElements are declared. |
boolean |
hasAnnotationElement(AnnotationElement annotationElement)
Return whether or not this
JavaAnnotation declares the given AnnotationElement instance. |
boolean |
hasAnnotationElement(String name)
Return whether or not this
JavaAnnotation declares an AnnotationElement with the given name. |
JavaAnnotation |
removeAnnotationElement(AnnotationElement annotationElement)
Remove the given
AnnotationElement from this JavaAnnotation instance, if it exists; otherwise, do
nothing. |
getCanonicalName, getEnclosingType, getNestedClasses, getQualifiedName, getSourceType, getSyntaxErrors, hasSyntaxErrors, isAnnotation, isClass, isEnum, isInterfacegetPackage, isDefaultPackage, setDefaultPackage, setPackageaddImport, addImport, addImport, addImport, getImport, getImport, getImport, getImport, getImports, hasImport, hasImport, hasImport, hasImport, removeImport, removeImport, removeImport, removeImport, requiresImport, requiresImport, resolveTypegetVisibility, isPackagePrivate, isPrivate, isProtected, isPublic, setPackagePrivate, setPrivate, setProtected, setPublic, setVisibilityaddAnnotation, addAnnotation, addAnnotation, getAnnotation, getAnnotation, getAnnotations, hasAnnotation, hasAnnotation, removeAnnotationgetInternalgetMembersAnnotationElement addAnnotationElement()
AnnotationElement to this JavaAnnotation instance. This will be a stub until
further modified.AnnotationElement addAnnotationElement(String declaration)
AnnotationElement declaration to this JavaAnnotation instance, using the given
String as the declaration.
For example:AnnotationElement e = javaClass.addAnnotationElement("String newAnnotationElement();");boolean hasAnnotationElement(String name)
JavaAnnotation declares an AnnotationElement with the given name.boolean hasAnnotationElement(AnnotationElement annotationElement)
JavaAnnotation declares the given AnnotationElement instance.AnnotationElement getAnnotationElement(String name)
AnnotationElement with the given name and return it, otherwise, return null.List<AnnotationElement> getAnnotationElements()
AnnotationElements declared by this JavaAnnotation, or return an empty list if
no AnnotationElements are declared.JavaAnnotation removeAnnotationElement(AnnotationElement annotationElement)
AnnotationElement from this JavaAnnotation instance, if it exists; otherwise, do
nothing.Copyright © 2013 JBoss by Red Hat. All Rights Reserved.