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 java.lang.Object implements RegisterGlobalsParticipant<ConstructorDeclaration>, TransformationParticipant<MutableConstructorDeclaration>, CodeGenerationParticipant<ConstructorDeclaration>, ValidationParticipant<ConstructorDeclaration>
A convenient base class to process active annotations for constructors.- Since:
- 2.8
-
-
Constructor Summary
Constructors Constructor Description AbstractConstructorProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoGenerateCode(java.util.List<? extends ConstructorDeclaration> annotatedConstructors, CodeGenerationContext context)Invoked by the compiler during the code generation phase.voiddoGenerateCode(ConstructorDeclaration annotatedConstructor, CodeGenerationContext context)voiddoRegisterGlobals(java.util.List<? extends ConstructorDeclaration> annotatedConstructors, RegisterGlobalsContext context)Called by the compiler during register-globals phase.voiddoRegisterGlobals(ConstructorDeclaration annotatedConstructor, RegisterGlobalsContext context)voiddoTransform(java.util.List<? extends MutableConstructorDeclaration> annotatedConstructors, TransformationContext context)Invoked by the compilervoiddoTransform(MutableConstructorDeclaration annotatedConstructor, TransformationContext context)voiddoValidate(java.util.List<? extends ConstructorDeclaration> annotatedConstructors, ValidationContext context)Invoked by the validatorvoiddoValidate(ConstructorDeclaration annotatedConstructor, ValidationContext context)Invoked by the validator
-
-
-
Method Detail
-
doRegisterGlobals
public void doRegisterGlobals(java.util.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:
RegisterGlobalsContext
-
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(java.util.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(java.util.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(java.util.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
public void doValidate(ConstructorDeclaration annotatedConstructor, ValidationContext context)
Invoked by the validator- Parameters:
annotatedConstructor- that generated method that should be validatedcontext-- Since:
- 2.7
- See Also:
doValidate(ConstructorDeclaration, ValidationContext)
-
-