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