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:
javax.annotation.processing.Processor

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


Field Summary
protected  java.util.Properties actions
          the map of actions processed, keys are the action commaned and values are fqn of implementations
protected  java.lang.String actionsFileLocation
          the relative path where to store actions mapping, will be complete with the name of base action to use
protected  javax.lang.model.element.AnnotationValueVisitor<java.lang.Object,java.lang.Void> annotationValueExtractor
          Extractor of values of annotations found
protected  javax.lang.model.element.TypeElement baseActionElement
          the type element of the base action to be used by ActionProvider
protected  java.lang.String baseFQN
          the fqn of the base action class to be used
protected  java.util.List<java.lang.String> processedClass
          the list of class processed by the processor
protected  java.lang.String providerDeclarationLocation
          the ActionProvider service declaration relative path
protected  java.lang.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  java.lang.String findMappingFile()
           
protected  java.lang.String[] getActionNames(javax.lang.model.element.AnnotationMirror element)
          Obtain the array of names to be used by the annotation
protected  javax.lang.model.element.AnnotationValueVisitor<java.lang.Object,java.lang.Void> getAnnotationValueExtractor()
           
 void init(javax.annotation.processing.ProcessingEnvironment processingEnv)
           
protected  java.util.Properties loadOldActionMapping()
           
protected  void parseOptions()
           
protected  void printDebug(java.lang.String msg)
           
protected  void printInfo(java.lang.String msg)
           
protected  void printWarning(java.lang.String msg)
           
 boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
           
protected  boolean registerActionsForClass(javax.lang.model.type.TypeMirror annotationType, javax.lang.model.element.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 java.lang.String providerDeclarationLocation
the ActionProvider service declaration relative path


actionsFileLocation

protected java.lang.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 java.util.List<java.lang.String> processedClass
the list of class processed by the processor


actions

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


annotationValueExtractor

protected javax.lang.model.element.AnnotationValueVisitor<java.lang.Object,java.lang.Void> annotationValueExtractor
Extractor of values of annotations found


baseActionElement

protected javax.lang.model.element.TypeElement baseActionElement
the type element of the base action to be used by ActionProvider


providerFQN

protected java.lang.String providerFQN
the fqn of the action provider to generate


baseFQN

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

Constructor Detail

ActionAnnotationProcessing

public ActionAnnotationProcessing()
Method Detail

init

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

process

public boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations,
                       javax.annotation.processing.RoundEnvironment roundEnv)
Specified by:
process in interface javax.annotation.processing.Processor
Specified by:
process in class javax.annotation.processing.AbstractProcessor

findMappingFile

protected java.lang.String findMappingFile()
                                    throws java.io.IOException
Throws:
java.io.IOException

registerActionsForClass

protected boolean registerActionsForClass(javax.lang.model.type.TypeMirror annotationType,
                                          javax.lang.model.element.Element e)

parseOptions

protected void parseOptions()

writeProviderClass

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

writeProviderServiceDeclaration

protected void writeProviderServiceDeclaration()
                                        throws java.io.IOException
Throws:
java.io.IOException

writeActionMapping

protected void writeActionMapping()
                           throws java.io.IOException
Throws:
java.io.IOException

loadOldActionMapping

protected java.util.Properties loadOldActionMapping()
                                             throws java.io.IOException
Throws:
java.io.IOException

getActionNames

protected java.lang.String[] getActionNames(javax.lang.model.element.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 javax.lang.model.element.AnnotationValueVisitor<java.lang.Object,java.lang.Void> getAnnotationValueExtractor()

printWarning

protected void printWarning(java.lang.String msg)

printInfo

protected void printInfo(java.lang.String msg)

printDebug

protected void printDebug(java.lang.String msg)


Copyright © 2008-2009 CodeLutin. All Rights Reserved.