org.nuiton.jaxx.action
Class ActionAnnotationProcessing

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by org.nuiton.jaxx.action.ActionAnnotationProcessing
All Implemented Interfaces:
Processor

@SupportedAnnotationTypes(value="org.nuiton.jaxx.action.*")
@SupportedSourceVersion(value=RELEASE_6)
@SupportedOptions(value="jaxx.verbose")
public class ActionAnnotationProcessing
extends AbstractProcessor


Field Summary
protected  Properties actions
          the map of actions processed, keys are the action commaned and values are fqn of implementations
protected  String actionsFileLocation
          the relative path where to store actions mapping, will be complete with the name of base action to use
protected  AnnotationValueVisitor<Object,Void> annotationValueExtractor
          Extractor of values of annotations found
protected  TypeElement baseActionElement
          the type element of the base action to be used by ActionProvider
protected  String baseFQN
          the fqn of the base action class to be used
protected  List<String> processedClass
          the list of class processed by the processor
protected  String providerDeclarationLocation
          the ActionProvider service declaration relative path
protected  String providerFQN
          the fqn of the action provider to generate
protected  boolean verbose
          verbose flag (can be activated by passing an annotation parameter to compiler via -Ai18n.verbose)
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
ActionAnnotationProcessing()
           
 
Method Summary
protected  String findMappingFile()
           
protected  String[] getActionNames(AnnotationMirror element)
          Obtain the array of names to be used by the annotation
protected  AnnotationValueVisitor<Object,Void> getAnnotationValueExtractor()
           
 void init(ProcessingEnvironment processingEnv)
           
protected  Properties loadOldActionMapping()
           
protected  void parseOptions()
           
protected  void printDebug(String msg)
           
protected  void printInfo(String msg)
           
protected  void printWarning(String msg)
           
 boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
           
protected  boolean registerActionsForClass(TypeMirror annotationType, Element e)
           
protected  void writeActionMapping()
           
protected  void writeProviderClass()
           
protected  void writeProviderServiceDeclaration()
           
 
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

providerDeclarationLocation

protected String providerDeclarationLocation
the ActionProvider service declaration relative path


actionsFileLocation

protected String actionsFileLocation
the relative path where to store actions mapping, will be complete with the name of base action to use


verbose

protected boolean verbose
verbose flag (can be activated by passing an annotation parameter to compiler via -Ai18n.verbose)


processedClass

protected List<String> processedClass
the list of class processed by the processor


actions

protected Properties actions
the map of actions processed, keys are the action commaned and values are fqn of implementations


annotationValueExtractor

protected AnnotationValueVisitor<Object,Void> annotationValueExtractor
Extractor of values of annotations found


baseActionElement

protected TypeElement baseActionElement
the type element of the base action to be used by ActionProvider


providerFQN

protected String providerFQN
the fqn of the action provider to generate


baseFQN

protected String baseFQN
the fqn of the base action class to be used

Constructor Detail

ActionAnnotationProcessing

public ActionAnnotationProcessing()
Method Detail

init

public void init(ProcessingEnvironment processingEnv)
Specified by:
init in interface Processor
Overrides:
init in class AbstractProcessor

process

public boolean process(Set<? extends TypeElement> annotations,
                       RoundEnvironment roundEnv)
Specified by:
process in interface Processor
Specified by:
process in class AbstractProcessor

findMappingFile

protected String findMappingFile()
                          throws IOException
Throws:
IOException

registerActionsForClass

protected boolean registerActionsForClass(TypeMirror annotationType,
                                          Element e)

parseOptions

protected void parseOptions()

writeProviderClass

protected void writeProviderClass()
                           throws IOException,
                                  javassist.NotFoundException,
                                  javassist.CannotCompileException,
                                  ClassNotFoundException
Throws:
IOException
javassist.NotFoundException
javassist.CannotCompileException
ClassNotFoundException

writeProviderServiceDeclaration

protected void writeProviderServiceDeclaration()
                                        throws IOException
Throws:
IOException

writeActionMapping

protected void writeActionMapping()
                           throws IOException
Throws:
IOException

loadOldActionMapping

protected Properties loadOldActionMapping()
                                   throws IOException
Throws:
IOException

getActionNames

protected String[] getActionNames(AnnotationMirror element)
Obtain the array of names to be used by the annotation

Parameters:
element - the dictonnary of values found in a annotation
Returns:
thee array of names detected in the annotation

getAnnotationValueExtractor

protected AnnotationValueVisitor<Object,Void> getAnnotationValueExtractor()

printWarning

protected void printWarning(String msg)

printInfo

protected void printInfo(String msg)

printDebug

protected void printDebug(String msg)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.