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