Interface JavaAnnotationSource
- All Superinterfaces:
AnnotationTarget<JavaAnnotationSource>,AnnotationTargetSource<JavaAnnotationSource,,JavaAnnotationSource> Importer<JavaAnnotationSource>,Internal,JavaAnnotation<JavaAnnotationSource>,JavaDocCapable<JavaAnnotationSource>,JavaDocCapableSource<JavaAnnotationSource>,JavaSource<JavaAnnotationSource>,JavaType<JavaAnnotationSource>,LocationCapable,Named,NamedSource<JavaAnnotationSource>,Origin<JavaAnnotationSource>,Packaged<JavaAnnotationSource>,PackagedSource<JavaAnnotationSource>,TypeHolder<JavaAnnotationSource>,TypeHolderSource<JavaAnnotationSource>,VisibilityScoped,VisibilityScopedSource<JavaAnnotationSource>
public interface JavaAnnotationSource
extends JavaAnnotation<JavaAnnotationSource>, JavaSource<JavaAnnotationSource>, TypeHolderSource<JavaAnnotationSource>
Represents a Java
@interface annotation source file as an in-memory modifiable element. See Roaster
for various options in generating JavaAnnotationSource instances.- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionAdd a new JavaAnnotationElementSourceto thisJavaAnnotationSourceinstance.addAnnotationElement(String declaration) Add a newAnnotationElementSourcedeclaration to thisJavaAnnotationSourceinstance, using the givenStringas the declaration.getAnnotationElement(String name) Get theAnnotationElementSourcewith the given name and return it, otherwise, return null.Get a list of allAnnotationElementSources declared by thisJavaAnnotation, or return an empty list if noAnnotationElementSources are declared.removeAnnotationElement(AnnotationElement<?> annotationElement) Remove the givenAnnotationElementfrom thisJavaAnnotationSourceinstance, if it exists; otherwise, do nothing.Methods inherited from interface org.jboss.forge.roaster.model.AnnotationTarget
hasAnnotation, hasAnnotationMethods inherited from interface org.jboss.forge.roaster.model.source.AnnotationTargetSource
addAnnotation, addAnnotation, addAnnotation, getAnnotation, getAnnotation, getAnnotations, removeAllAnnotations, removeAnnotationMethods inherited from interface org.jboss.forge.roaster.model.source.Importer
addImport, addImport, addImport, addImport, addImport, getImport, getImport, getImport, getImport, getImports, hasImport, hasImport, hasImport, hasImport, removeImport, removeImport, removeImport, removeImport, requiresImport, requiresImport, resolveTypeMethods inherited from interface org.jboss.forge.roaster.Internal
getInternalMethods inherited from interface org.jboss.forge.roaster.model.JavaAnnotation
hasAnnotationElement, hasAnnotationElementMethods inherited from interface org.jboss.forge.roaster.model.JavaDocCapable
hasJavaDocMethods inherited from interface org.jboss.forge.roaster.model.source.JavaDocCapableSource
getJavaDoc, removeJavaDocMethods inherited from interface org.jboss.forge.roaster.model.source.JavaSource
getEnclosingTypeMethods inherited from interface org.jboss.forge.roaster.model.JavaType
getCanonicalName, getQualifiedName, getSyntaxErrors, hasSyntaxErrors, isAnnotation, isClass, isEnum, isInterface, isRecord, toUnformattedStringMethods inherited from interface org.jboss.forge.roaster.model.source.LocationCapable
getColumnNumber, getEndPosition, getLineNumber, getStartPositionMethods inherited from interface org.jboss.forge.roaster.model.source.NamedSource
setNameMethods inherited from interface org.jboss.forge.roaster.model.Packaged
getPackage, isDefaultPackageMethods inherited from interface org.jboss.forge.roaster.model.source.PackagedSource
setDefaultPackage, setPackageMethods inherited from interface org.jboss.forge.roaster.model.TypeHolder
hasNestedType, hasNestedType, hasNestedTypeMethods inherited from interface org.jboss.forge.roaster.model.source.TypeHolderSource
addNestedType, addNestedType, addNestedType, getNestedType, getNestedTypes, removeNestedTypeMethods inherited from interface org.jboss.forge.roaster.model.VisibilityScoped
getVisibility, isPackagePrivate, isPrivate, isProtected, isPublicMethods inherited from interface org.jboss.forge.roaster.model.source.VisibilityScopedSource
setPackagePrivate, setPrivate, setProtected, setPublic, setVisibility
-
Method Details
-
getAnnotationElement
Get theAnnotationElementSourcewith the given name and return it, otherwise, return null.- Specified by:
getAnnotationElementin interfaceJavaAnnotation<JavaAnnotationSource>
-
getAnnotationElements
List<AnnotationElementSource> getAnnotationElements()Get a list of allAnnotationElementSources declared by thisJavaAnnotation, or return an empty list if noAnnotationElementSources are declared.- Specified by:
getAnnotationElementsin interfaceJavaAnnotation<JavaAnnotationSource>
-
addAnnotationElement
AnnotationElementSource addAnnotationElement()Add a new JavaAnnotationElementSourceto thisJavaAnnotationSourceinstance. This will be a stub until further modified. -
addAnnotationElement
Add a newAnnotationElementSourcedeclaration to thisJavaAnnotationSourceinstance, using the givenStringas the declaration. For example:
AnnotationElement e = javaClass.addAnnotationElement("String newAnnotationElement();"); -
removeAnnotationElement
Remove the givenAnnotationElementfrom thisJavaAnnotationSourceinstance, if it exists; otherwise, do nothing.
-