Module org.eclipse.xtend.lib.macro
Package org.eclipse.xtend.lib.macro
Class AbstractAnnotationTypeProcessor
java.lang.Object
org.eclipse.xtend.lib.macro.AbstractAnnotationTypeProcessor
- All Implemented Interfaces:
CodeGenerationParticipant<AnnotationTypeDeclaration>,RegisterGlobalsParticipant<AnnotationTypeDeclaration>,TransformationParticipant<MutableAnnotationTypeDeclaration>,ValidationParticipant<AnnotationTypeDeclaration>
@Beta
public abstract class AbstractAnnotationTypeProcessor
extends Object
implements RegisterGlobalsParticipant<AnnotationTypeDeclaration>, TransformationParticipant<MutableAnnotationTypeDeclaration>, CodeGenerationParticipant<AnnotationTypeDeclaration>, ValidationParticipant<AnnotationTypeDeclaration>
A convenient base class to process active annotations for annotation types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoGenerateCode(List<? extends AnnotationTypeDeclaration> annotatedSourceElements, CodeGenerationContext context) Invoked by the compiler during the code generation phase.voiddoGenerateCode(AnnotationTypeDeclaration annotatedAnnotationType, CodeGenerationContext context) Called during code generation.voiddoRegisterGlobals(List<? extends AnnotationTypeDeclaration> annotatedAnnotationTypes, RegisterGlobalsContext context) Called by the compiler during register-globals phase.voiddoRegisterGlobals(AnnotationTypeDeclaration annotatedAnnotationType, RegisterGlobalsContext context) Called during global symbol collecting.voiddoTransform(List<? extends MutableAnnotationTypeDeclaration> annotatedAnnotationTypes, TransformationContext context) Invoked by the compilervoiddoTransform(MutableAnnotationTypeDeclaration annotatedAnnotationType, TransformationContext context) voiddoValidate(List<? extends AnnotationTypeDeclaration> annotatedAnnotationTypes, ValidationContext context) Invoked by the validatorvoiddoValidate(AnnotationTypeDeclaration annotatedAnnotationType, ValidationContext context) Invoked by the validator
-
Constructor Details
-
AbstractAnnotationTypeProcessor
public AbstractAnnotationTypeProcessor()
-
-
Method Details
-
doRegisterGlobals
public void doRegisterGlobals(List<? extends AnnotationTypeDeclaration> annotatedAnnotationTypes, @Extension RegisterGlobalsContext context) Description copied from interface:RegisterGlobalsParticipantCalled by the compiler during register-globals phase.- Specified by:
doRegisterGlobalsin interfaceRegisterGlobalsParticipant<AnnotationTypeDeclaration>- Parameters:
annotatedAnnotationTypes- the source elements from the currently processed compilation unit which are annotated with active annotationcontext- services to register new Java types- See Also:
-
doRegisterGlobals
public void doRegisterGlobals(AnnotationTypeDeclaration annotatedAnnotationType, @Extension RegisterGlobalsContext context) Called during global symbol collecting.- Parameters:
annotatedAnnotationType- a source element annotated with the annotation this processor is responsible for.context-
-
doTransform
public void doTransform(List<? extends MutableAnnotationTypeDeclaration> annotatedAnnotationTypes, @Extension TransformationContext context) Description copied from interface:TransformationParticipantInvoked by the compiler- Specified by:
doTransformin interfaceTransformationParticipant<MutableAnnotationTypeDeclaration>- Parameters:
annotatedAnnotationTypes- the mutable java representation of the annotated elementscontext- aTransformationContextproviding useful services.
-
doTransform
public void doTransform(MutableAnnotationTypeDeclaration annotatedAnnotationType, @Extension TransformationContext context) - Parameters:
annotatedAnnotationType- a mutable annotation type representation annotated with the annotation this processor is responsible for.context-
-
doGenerateCode
public void doGenerateCode(List<? extends AnnotationTypeDeclaration> annotatedSourceElements, @Extension CodeGenerationContext context) Description copied from interface:CodeGenerationParticipantInvoked by the compiler during the code generation phase.- Specified by:
doGenerateCodein interfaceCodeGenerationParticipant<AnnotationTypeDeclaration>- Parameters:
annotatedSourceElements- the immutable source representation (i.e. the Xtend AST) of the annotated elementscontext- aTransformationContextproviding useful services.
-
doGenerateCode
public void doGenerateCode(AnnotationTypeDeclaration annotatedAnnotationType, @Extension CodeGenerationContext context) Called during code generation.- Parameters:
annotatedAnnotationType- a source element annotated with the annotation this processor is responsible for.context-- See Also:
-
doValidate
public void doValidate(List<? extends AnnotationTypeDeclaration> annotatedAnnotationTypes, @Extension ValidationContext context) Description copied from interface:ValidationParticipantInvoked by the validator- Specified by:
doValidatein interfaceValidationParticipant<AnnotationTypeDeclaration>- Parameters:
annotatedAnnotationTypes- the java representation of the annotated elementscontext- aValidationContextproviding useful services.
-
doValidate
public void doValidate(AnnotationTypeDeclaration annotatedAnnotationType, @Extension ValidationContext context) Invoked by the validator- Parameters:
annotatedAnnotationType- the generated annotation type that should be validatedcontext-- Since:
- 2.7
- See Also:
-