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 java.lang.Object implements RegisterGlobalsParticipant<MethodDeclaration>, TransformationParticipant<MutableMethodDeclaration>, CodeGenerationParticipant<MethodDeclaration>, ValidationParticipant<MethodDeclaration>
A convenient base class to process active annotations for methods.
-
-
Constructor Summary
Constructors Constructor Description AbstractMethodProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoGenerateCode(java.util.List<? extends MethodDeclaration> annotatedMethods, CodeGenerationContext context)Invoked by the compiler during the code generation phase.voiddoGenerateCode(MethodDeclaration annotatedMethod, CodeGenerationContext context)voiddoRegisterGlobals(java.util.List<? extends MethodDeclaration> annotatedMethods, RegisterGlobalsContext context)Called by the compiler during register-globals phase.voiddoRegisterGlobals(MethodDeclaration annotatedMethod, RegisterGlobalsContext context)voiddoTransform(java.util.List<? extends MutableMethodDeclaration> annotatedMethods, TransformationContext context)Invoked by the compilervoiddoTransform(MutableMethodDeclaration annotatedMethod, TransformationContext context)voiddoValidate(java.util.List<? extends MethodDeclaration> annotatedMethods, ValidationContext context)Invoked by the validatorvoiddoValidate(MethodDeclaration annotatedMethod, ValidationContext context)Invoked by the validator
-
-
-
Method Detail
-
doRegisterGlobals
public void doRegisterGlobals(java.util.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:
RegisterGlobalsContext
-
doRegisterGlobals
public void doRegisterGlobals(MethodDeclaration annotatedMethod, RegisterGlobalsContext context)
- Parameters:
annotatedMethod- a source method annotated with the annotation this processor is responsible for.context-
-
doTransform
public void doTransform(java.util.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(java.util.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(java.util.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
public void doValidate(MethodDeclaration annotatedMethod, ValidationContext context)
Invoked by the validator- Parameters:
annotatedMethod- that generated method that should be validatedcontext-- Since:
- 2.7
- See Also:
doValidate(MethodDeclaration, ValidationContext)
-
-