pt.digitalis.dif.codegen.util
Interface IClassEnhancer

All Known Implementing Classes:
ClassEnhancerImpl

public interface IClassEnhancer

Defines the basic behavior that any DIF class enhancer must implement.

Author:
Pedro Viegas pviegas@digitalis.pt, Rodrigo Gonçalves rgoncalves@digitalis.pt
Created on:
Jul 23, 2007

Method Summary
 pt.digitalis.utils.bytecode.holders.ClassHolder enhance(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
          Enhances a given class.
 void processAnnotation(ClassEnhancementContext classEnhancementContext, pt.digitalis.utils.bytecode.holders.AnnotationHolder annotation, DEMAnnotationLogic annotationLogic)
          Processes a given type-targeted annotation, enhancing the class with bytecode generated accordingly to the annotation.
 void processAnnotation(ClassEnhancementContext classEnhancementContext, pt.digitalis.utils.bytecode.holders.AttributeHolder attribute, pt.digitalis.utils.bytecode.holders.AnnotationHolder annotation, DEMAnnotationLogic annotationLogic)
          Processes a given field-targeted annotation, enhancing the class with bytecode generated accordingly to the annotation.
 void processAnnotation(ClassEnhancementContext classEnhancementContext, pt.digitalis.utils.bytecode.holders.MethodHolder method, pt.digitalis.utils.bytecode.holders.AnnotationHolder annotation, DEMAnnotationLogic annotationLogic)
          Processes a given method-targeted annotation, enhancing the class with bytecode generated accordingly to the annotation.
 

Method Detail

enhance

pt.digitalis.utils.bytecode.holders.ClassHolder enhance(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
                                                        throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException,
                                                               pt.digitalis.utils.bytecode.exceptions.CodeGenerationException,
                                                               AnnotationMisuseException,
                                                               DIFCodeGenerationException
Enhances a given class.

Parameters:
clazz - the class to enhance.
Returns:
the entity class for DEMRegistry addition
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if the class could not be loaded
pt.digitalis.utils.bytecode.exceptions.CodeGenerationException - if class could not be enhanced
AnnotationMisuseException - if an inappropriate annotation use was made
DIFCodeGenerationException

processAnnotation

void processAnnotation(ClassEnhancementContext classEnhancementContext,
                       pt.digitalis.utils.bytecode.holders.AnnotationHolder annotation,
                       DEMAnnotationLogic annotationLogic)
                       throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException,
                              pt.digitalis.utils.bytecode.exceptions.CodeGenerationException,
                              DIFCodeGenerationException
Processes a given type-targeted annotation, enhancing the class with bytecode generated accordingly to the annotation.

Parameters:
classEnhancementContext - the class enhancement context
annotation - the annotation used to choose the appropriate code enhancement
annotationLogic - the annotationLogic class implementation
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if any need resource can't be found or loaded
pt.digitalis.utils.bytecode.exceptions.CodeGenerationException - if source code can not be compiled or appended to class
DIFCodeGenerationException

processAnnotation

void processAnnotation(ClassEnhancementContext classEnhancementContext,
                       pt.digitalis.utils.bytecode.holders.AttributeHolder attribute,
                       pt.digitalis.utils.bytecode.holders.AnnotationHolder annotation,
                       DEMAnnotationLogic annotationLogic)
                       throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException,
                              pt.digitalis.utils.bytecode.exceptions.CodeGenerationException,
                              DIFCodeGenerationException
Processes a given field-targeted annotation, enhancing the class with bytecode generated accordingly to the annotation.

Parameters:
classEnhancementContext - the class enhancement context
attribute - annotated attribute
annotation - the annotation used to choose the appropriate code enhancement
annotationLogic - the annotationLogic class implementation
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if any need resource can't be found or loaded
pt.digitalis.utils.bytecode.exceptions.CodeGenerationException - if source code can not be compiled or appended to class
DIFCodeGenerationException

processAnnotation

void processAnnotation(ClassEnhancementContext classEnhancementContext,
                       pt.digitalis.utils.bytecode.holders.MethodHolder method,
                       pt.digitalis.utils.bytecode.holders.AnnotationHolder annotation,
                       DEMAnnotationLogic annotationLogic)
                       throws pt.digitalis.utils.inspection.exception.ResourceNotFoundException,
                              pt.digitalis.utils.bytecode.exceptions.CodeGenerationException,
                              DIFCodeGenerationException
Processes a given method-targeted annotation, enhancing the class with bytecode generated accordingly to the annotation.

Parameters:
classEnhancementContext - the class enhancement context
method - annotated method
annotation - the annotation used to choose the appropriate code enhancement
annotationLogic - the annotationLogic class implementation
Throws:
pt.digitalis.utils.inspection.exception.ResourceNotFoundException - if any need resource can't be found or loaded
pt.digitalis.utils.bytecode.exceptions.CodeGenerationException - if source code can not be compiled or appended to class
DIFCodeGenerationException


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.