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@interfaceannotation source file as an in-memory modifiable element. SeeRoasterfor various options in generatingJavaAnnotationSourceinstances.- Author:
- Lincoln Baxter, III
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AnnotationElementSourceaddAnnotationElement()Add a new JavaAnnotationElementSourceto thisJavaAnnotationSourceinstance.AnnotationElementSourceaddAnnotationElement(java.lang.String declaration)Add a newAnnotationElementSourcedeclaration to thisJavaAnnotationSourceinstance, using the givenStringas the declaration.AnnotationElementSourcegetAnnotationElement(java.lang.String name)Get theAnnotationElementSourcewith the given name and return it, otherwise, return null.java.util.List<AnnotationElementSource>getAnnotationElements()Get a list of allAnnotationElementSources declared by thisJavaAnnotation, or return an empty list if noAnnotationElementSources are declared.JavaAnnotationSourceremoveAnnotationElement(AnnotationElement<?> annotationElement)Remove the givenAnnotationElementfrom thisJavaAnnotationSourceinstance, if it exists; otherwise, do nothing.-
Methods inherited from interface org.jboss.forge.roaster.model.AnnotationTarget
hasAnnotation, hasAnnotation
-
Methods inherited from interface org.jboss.forge.roaster.model.source.AnnotationTargetSource
addAnnotation, addAnnotation, addAnnotation, getAnnotation, getAnnotation, getAnnotations, removeAllAnnotations, removeAnnotation
-
Methods 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, resolveType
-
Methods inherited from interface org.jboss.forge.roaster.Internal
getInternal
-
Methods inherited from interface org.jboss.forge.roaster.model.JavaAnnotation
hasAnnotationElement, hasAnnotationElement
-
Methods inherited from interface org.jboss.forge.roaster.model.JavaDocCapable
hasJavaDoc
-
Methods inherited from interface org.jboss.forge.roaster.model.source.JavaDocCapableSource
getJavaDoc, removeJavaDoc
-
Methods inherited from interface org.jboss.forge.roaster.model.source.JavaSource
getEnclosingType
-
Methods inherited from interface org.jboss.forge.roaster.model.JavaType
getCanonicalName, getQualifiedName, getSyntaxErrors, hasSyntaxErrors, isAnnotation, isClass, isEnum, isInterface, toUnformattedString
-
Methods inherited from interface org.jboss.forge.roaster.model.source.LocationCapable
getColumnNumber, getEndPosition, getLineNumber, getStartPosition
-
Methods inherited from interface org.jboss.forge.roaster.model.source.NamedSource
setName
-
Methods inherited from interface org.jboss.forge.roaster.model.Packaged
getPackage, isDefaultPackage
-
Methods inherited from interface org.jboss.forge.roaster.model.source.PackagedSource
setDefaultPackage, setPackage
-
Methods inherited from interface org.jboss.forge.roaster.model.TypeHolder
hasNestedType, hasNestedType, hasNestedType
-
Methods inherited from interface org.jboss.forge.roaster.model.source.TypeHolderSource
addNestedType, addNestedType, addNestedType, getNestedType, getNestedTypes, removeNestedType
-
Methods inherited from interface org.jboss.forge.roaster.model.VisibilityScoped
getVisibility, isPackagePrivate, isPrivate, isProtected, isPublic
-
Methods inherited from interface org.jboss.forge.roaster.model.source.VisibilityScopedSource
setPackagePrivate, setPrivate, setProtected, setPublic, setVisibility
-
-
-
-
Method Detail
-
getAnnotationElement
AnnotationElementSource getAnnotationElement(java.lang.String name)
Get theAnnotationElementSourcewith the given name and return it, otherwise, return null.- Specified by:
getAnnotationElementin interfaceJavaAnnotation<JavaAnnotationSource>
-
getAnnotationElements
java.util.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
AnnotationElementSource addAnnotationElement(java.lang.String declaration)
Add a newAnnotationElementSourcedeclaration to thisJavaAnnotationSourceinstance, using the givenStringas the declaration. For example:
AnnotationElement e = javaClass.addAnnotationElement("String newAnnotationElement();");
-
removeAnnotationElement
JavaAnnotationSource removeAnnotationElement(AnnotationElement<?> annotationElement)
Remove the givenAnnotationElementfrom thisJavaAnnotationSourceinstance, if it exists; otherwise, do nothing.
-
-