org.squashtest.tm.tools.annotation.processor
Class DynamicDaoProcessor

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by org.squashtest.tm.tools.annotation.processor.DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
          extended by org.squashtest.tm.tools.annotation.processor.DynamicDaoProcessor
All Implemented Interfaces:
Processor

@SupportedAnnotationTypes(value="org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao")
@SupportedSourceVersion(value=RELEASE_6)
public class DynamicDaoProcessor
extends DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>

Consumes DynamicManager annotated interfacrs and produces spring configuration accordlingly.

Author:
Gregory Fouquet

Field Summary
 
Fields inherited from class org.squashtest.tm.tools.annotation.processor.DynamicComponentProcessor
DYNAMIC_COMPONENT_TEMPLATE
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
DynamicDaoProcessor()
           
 
Method Summary
protected  Class<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao> annotationClass()
           
protected  String beanFactoryClass()
           
protected  String beanName(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao componentDefinition)
          Should get the "name" property of the annotation.
protected  Class<?> entityClass(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao componentDefinition)
          Should get the entity property of the given component definition.
protected  String generatedFileName()
           
protected  boolean lookupCustomImplementation(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao definition)
          (non-Javadoc)
protected  CharSequence sessionFactoryName(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao definition, Element component)
          (non-Javadoc)
 
Methods inherited from class org.squashtest.tm.tools.annotation.processor.DynamicComponentProcessor
checkSessionFactoryName, getMessager, init, process
 
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
 

Constructor Detail

DynamicDaoProcessor

public DynamicDaoProcessor()
Method Detail

annotationClass

protected Class<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao> annotationClass()
Specified by:
annotationClass in class DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
See Also:
DynamicComponentProcessor.annotationClass()

entityClass

protected Class<?> entityClass(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao componentDefinition)
Description copied from class: DynamicComponentProcessor
Should get the entity property of the given component definition. Which should puke a MirroredTypeException but it's OK.

Specified by:
entityClass in class DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
Returns:
See Also:
DynamicComponentProcessor.entityClass(java.lang.annotation.Annotation)

beanName

protected String beanName(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao componentDefinition)
Description copied from class: DynamicComponentProcessor
Should get the "name" property of the annotation.

Specified by:
beanName in class DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
Returns:
See Also:
DynamicComponentProcessor.beanName(java.lang.annotation.Annotation)

beanFactoryClass

protected String beanFactoryClass()
Specified by:
beanFactoryClass in class DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
See Also:
DynamicComponentProcessor.beanFactoryClass()

generatedFileName

protected String generatedFileName()
Specified by:
generatedFileName in class DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
See Also:
DynamicComponentProcessor.generatedFileName()

lookupCustomImplementation

protected boolean lookupCustomImplementation(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao definition)
(non-Javadoc)

Specified by:
lookupCustomImplementation in class DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
Returns:
whether dynamic component factory should lookup custom implementation or not.
See Also:
org.squashtest.tm.tools.annotation.processor.DynamicComponentProcessor#lookupCustomImplementation(java.lang. annotation.Annotation)

sessionFactoryName

protected CharSequence sessionFactoryName(org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao definition,
                                          Element component)
(non-Javadoc)

Specified by:
sessionFactoryName in class DynamicComponentProcessor<org.squashtest.tm.core.dynamicmanager.annotation.DynamicDao>
Returns:
the bean name of the session factory which should be used.
See Also:
org.squashtest.tm.tools.annotation.processor.DynamicComponentProcessor#sessionFactoryName(java.lang.annotation .Annotation)


Copyright © 2010-2014 Henix, henix.fr. All Rights Reserved.