Interface AnnotationTargetSource<O extends JavaSource<O>,T>
-
- All Superinterfaces:
AnnotationTarget<O>,Internal,Origin<O>
- All Known Subinterfaces:
AnnotationElementSource,EnumConstantSource,EnumConstantSource.Body,FieldSource<O>,JavaAnnotationSource,JavaClassSource,JavaEnumSource,JavaInterfaceSource,JavaPackageInfoSource,JavaRecord<O>,JavaRecordSource,JavaSource<T>,MemberSource<O,T>,MethodSource<O>,ParameterSource<O>
public interface AnnotationTargetSource<O extends JavaSource<O>,T> extends AnnotationTarget<O>
Represents a Java source element that may carry annotations.- Author:
- Lincoln Baxter, III
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AnnotationSource<O>addAnnotation()Add a new annotation instance to thisAnnotationTargetSource(note that an import statement must be added manually if required).AnnotationSource<O>addAnnotation(Class<? extends Annotation> type)Add a new annotation instance to thisAnnotationTargetSource, using the givenClassas the annotation type.AnnotationSource<O>addAnnotation(String className)Add a new annotation instance to thisAnnotationTargetSource, using the givenStringclassName as the annotation type.AnnotationSource<O>getAnnotation(Class<? extends Annotation> type)Returns the annotation bound of the given type in thisAnnotationTargetor null if it doesn't existAnnotationSource<O>getAnnotation(String type)Returns the annotation bound of the given type in thisAnnotationTargetor null if it doesn't existList<AnnotationSource<O>>getAnnotations()voidremoveAllAnnotations()Remove all annotations instance from thisAnnotationTargetSource.TremoveAnnotation(Annotation<O> annotation)Remove an annotation instance from thisAnnotationTargetSource.-
Methods inherited from interface org.jboss.forge.roaster.model.AnnotationTarget
hasAnnotation, hasAnnotation
-
Methods inherited from interface org.jboss.forge.roaster.Internal
getInternal
-
-
-
-
Method Detail
-
getAnnotations
List<AnnotationSource<O>> getAnnotations()
Description copied from interface:AnnotationTarget- Specified by:
getAnnotationsin interfaceAnnotationTarget<O extends JavaSource<O>>
-
getAnnotation
AnnotationSource<O> getAnnotation(Class<? extends Annotation> type)
Description copied from interface:AnnotationTargetReturns the annotation bound of the given type in thisAnnotationTargetor null if it doesn't exist- Specified by:
getAnnotationin interfaceAnnotationTarget<O extends JavaSource<O>>- Parameters:
type- TheAnnotationtype
-
getAnnotation
AnnotationSource<O> getAnnotation(String type)
Description copied from interface:AnnotationTargetReturns the annotation bound of the given type in thisAnnotationTargetor null if it doesn't exist- Specified by:
getAnnotationin interfaceAnnotationTarget<O extends JavaSource<O>>- Parameters:
type- The FQN of the annotation
-
addAnnotation
AnnotationSource<O> addAnnotation()
Add a new annotation instance to thisAnnotationTargetSource(note that an import statement must be added manually if required).
-
addAnnotation
AnnotationSource<O> addAnnotation(Class<? extends Annotation> type)
Add a new annotation instance to thisAnnotationTargetSource, using the givenClassas the annotation type. Attempt to add an import statement to this object'sAnnotationTargetSourceif required.
-
addAnnotation
AnnotationSource<O> addAnnotation(String className)
Add a new annotation instance to thisAnnotationTargetSource, using the givenStringclassName as the annotation type. Attempt to add an import statement to this object'sAnnotationTargetSourceif required (note that the given className must be fully-qualified in order to properly import required classes).
-
removeAnnotation
T removeAnnotation(Annotation<O> annotation)
Remove an annotation instance from thisAnnotationTargetSource.
-
removeAllAnnotations
void removeAllAnnotations()
Remove all annotations instance from thisAnnotationTargetSource.
-
-