Module org.eclipse.xtend.lib.macro
Interface AnnotationReferenceProvider
- All Known Subinterfaces:
TransformationContext,ValidationContext
@Beta
public interface AnnotationReferenceProvider
Creates
AnnotationReference instances.- Since:
- 2.6
- Author:
- Anton Kosyakov
-
Method Summary
Modifier and TypeMethodDescriptionnewAnnotationReference(Class<?> annotationClass) Creates a new annotation reference for the givenClass.newAnnotationReference(Class<?> annotationClass, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Creates a new annotation reference for the givenClass.newAnnotationReference(String annotationTypeName) Creates a new annotation reference for the given name.newAnnotationReference(String annotationTypeName, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Creates a new annotation reference for the given name.newAnnotationReference(AnnotationReference annotationReference) Create a new annotation reference base on the given annotation reference.newAnnotationReference(AnnotationReference annotationReference, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Create a new annotation reference base on the given annotation reference.newAnnotationReference(Type annotationTypeDelcaration) Creates a new annotation reference for the given type declaration.newAnnotationReference(Type annotationTypeDelcaration, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Creates a new annotation reference for the given type declaration.
-
Method Details
-
newAnnotationReference
Creates a new annotation reference for the given name.- Parameters:
annotationTypeName- the name of the annotation type to point to, must be a valid java identifier- Returns:
- a
AnnotationReferencepointing to the type with the give name, ornullif no such annotation type could be found. - Throws:
IllegalArgumentException- if thenameis not a valid java identifier
-
newAnnotationReference
Creates a new annotation reference for the given type declaration.- Parameters:
annotationTypeDelcaration- the annotation type to point to, must not benull.- Returns:
- a
AnnotationReferencepointing to the given type, ornullif the given type is not an annotation type. - Throws:
IllegalArgumentException- if the given type declaration is null
-
newAnnotationReference
Creates a new annotation reference for the givenClass.- Parameters:
annotationClass- theClassto point to, must not benull.- Returns:
- a
AnnotationReferencepointing to the given type, ornullif the given type is not on the class path of the compiled project or an annotation type. - Throws:
IllegalArgumentException- if the givenClassis null
-
newAnnotationReference
Create a new annotation reference base on the given annotation reference.- Parameters:
annotationReference- an annotation reference which is used as a base for a new annotation reference, must not benullor detached.- Returns:
- a
AnnotationReferenceconstructed based on the given annotation reference, can benull - Throws:
IllegalArgumentException- if the given annotation reference isnullor detached
-
newAnnotationReference
AnnotationReference newAnnotationReference(String annotationTypeName, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Creates a new annotation reference for the given name.- Parameters:
annotationTypeName- the name of the annotation type to point toinitializer- a callback for further initialization of the create annotation reference, must not benull.- Returns:
- a
AnnotationReferencepointing to the type with the give name, ornullif no such annotation type could be found. - Throws:
IllegalArgumentException- if thenameis not a valid java identifier or theinitializerisnull
-
newAnnotationReference
AnnotationReference newAnnotationReference(Type annotationTypeDelcaration, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Creates a new annotation reference for the given type declaration.- Parameters:
annotationTypeDelcaration- the annotation type to point to, must not benull.initializer- a callback for further initialization of the create annotation reference, must not benull.- Returns:
- a
AnnotationReferencepointing to the given type, ornullif the given type is not an annotation type. - Throws:
IllegalArgumentException- if the given type declaration isnullor theinitializerisnull
-
newAnnotationReference
AnnotationReference newAnnotationReference(Class<?> annotationClass, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Creates a new annotation reference for the givenClass.- Parameters:
annotationClass- theClassto point to, must not benull.initializer- a callback for further initialization of the create annotation reference, must not benull.- Returns:
- a
AnnotationReferencepointing to the given type, ornullif the given type is not on the class path of the compiled project or an annotation type. - Throws:
IllegalArgumentException- if the givenClassisnullor theinitializerisnull
-
newAnnotationReference
AnnotationReference newAnnotationReference(AnnotationReference annotationReference, org.eclipse.xtext.xbase.lib.Procedures.Procedure1<AnnotationReferenceBuildContext> initializer) Create a new annotation reference base on the given annotation reference.- Parameters:
annotationReference- an annotation reference which is used as a base for a new annotation reference, must not benullor detached.initializer- a callback for further initialization of the create annotation reference, must not benull.- Returns:
- a
AnnotationReferenceconstructed based on the given annotation reference, can benull - Throws:
IllegalArgumentException- if the given annotation reference isnullor detached; or theinitializerisnull
-