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