org.castor.core.annotationprocessing
Class BaseTargetAwareAnnotationProcessingService

java.lang.Object
  extended by org.castor.core.annotationprocessing.BaseAnnotationProcessingService
      extended by org.castor.core.annotationprocessing.BaseTargetAwareAnnotationProcessingService
All Implemented Interfaces:
AnnotationProcessingService, TargetAwareAnnotationProcessingService

public class BaseTargetAwareAnnotationProcessingService
extends BaseAnnotationProcessingService
implements TargetAwareAnnotationProcessingService

Base implementation class to be used for implementing AnnotationProcessingServices.

Since:
1.3.1
Author:
Alexander Eibner, Peter Schmidt
See Also:
AnnotationProcessingService

Constructor Summary
BaseTargetAwareAnnotationProcessingService()
           
 
Method Summary
 void addAnnotationProcessor(TargetAwareAnnotationProcessor taAnnotationProcessor)
          Add an TargetAwareAnnotationProcessor to the service.
 Set<AnnotationProcessor> getAllAnnotationProcessors()
          Returns the set of AnnotationProcessors and TargetAwareAnnotationProcessors registered with this service.
 Set<TargetAwareAnnotationProcessor> getTargetAwareAnnotationProcessors()
          Returns the set of TargetAwareAnnotationProcessors registered with this service.
<I extends BaseNature,A extends Annotation>
boolean
processAnnotation(I info, A annotation)
          This method acts like it's super method, but also tries to process the annotation with the TargetAwareAnnotationProcessors.
<I extends BaseNature,A extends Annotation>
boolean
processAnnotation(I info, A annotation, AnnotatedElement target)
          The processing action of this service.
<I extends BaseNature>
Annotation[]
processAnnotations(I info, Annotation[] annotations)
          This method acts like it's super method, but also tries to process the annotations with the TargetAwareAnnotationProcessors.
<I extends BaseNature>
Annotation[]
processAnnotations(I info, Annotation[] annotations, AnnotatedElement target)
          Calls AnnotationProcessingService.processAnnotation(BaseNature, Annotation) for each given Annotation.
 
Methods inherited from class org.castor.core.annotationprocessing.BaseAnnotationProcessingService
addAnnotationProcessor, getAnnotationProcessors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.castor.core.annotationprocessing.AnnotationProcessingService
addAnnotationProcessor, getAnnotationProcessors
 

Constructor Detail

BaseTargetAwareAnnotationProcessingService

public BaseTargetAwareAnnotationProcessingService()
Method Detail

addAnnotationProcessor

public void addAnnotationProcessor(TargetAwareAnnotationProcessor taAnnotationProcessor)
Add an TargetAwareAnnotationProcessor to the service.

Specified by:
addAnnotationProcessor in interface TargetAwareAnnotationProcessingService
Parameters:
taAnnotationProcessor - the TargetAwareAnnotationProcessor to add to this service.
See Also:
addAnnotationProcessor(AnnotationProcessor)

getAllAnnotationProcessors

public Set<AnnotationProcessor> getAllAnnotationProcessors()
Returns the set of AnnotationProcessors and TargetAwareAnnotationProcessors registered with this service.

Specified by:
getAllAnnotationProcessors in interface TargetAwareAnnotationProcessingService
Returns:
A set of AnnotationProcessors registered with this service.
See Also:
TargetAwareAnnotationProcessingService.getAllAnnotationProcessors()

getTargetAwareAnnotationProcessors

public Set<TargetAwareAnnotationProcessor> getTargetAwareAnnotationProcessors()
Returns the set of TargetAwareAnnotationProcessors registered with this service.

Specified by:
getTargetAwareAnnotationProcessors in interface TargetAwareAnnotationProcessingService
Returns:
A set of TargetAwareAnnotationProcessors registered with this service.
See Also:
TargetAwareAnnotationProcessingService.getTargetAwareAnnotationProcessors()

processAnnotation

public <I extends BaseNature,A extends Annotation> boolean processAnnotation(I info,
                                                                             A annotation,
                                                                             AnnotatedElement target)
                          throws AnnotationTargetException
The processing action of this service. If an annotation is given which is not supported by this processor false is returned. Otherwise the Annotations specific processor will (try to) process the Annotation and the result of TargetAwareAnnotationProcessor.processAnnotation(BaseNature, Annotation, AnnotatedElement) is returned.

Specified by:
processAnnotation in interface TargetAwareAnnotationProcessingService
Parameters:
info - the BaseNature (and so its PropertyHolder) that should be filled with the information read
annotation - the annotation to process
target - the target (AnnotatedElement) of the given annotation
Returns:
true, if the annotation was processed, false if not
Throws:
AnnotationTargetException - if an annotation is used in a context that is not valid.
See Also:
TargetAwareAnnotationProcessingService.processAnnotation(org.castor.core.nature.BaseNature, java.lang.annotation.Annotation, java.lang.reflect.AnnotatedElement)

processAnnotations

public <I extends BaseNature> Annotation[] processAnnotations(I info,
                                                              Annotation[] annotations,
                                                              AnnotatedElement target)
                                throws AnnotationTargetException
Calls AnnotationProcessingService.processAnnotation(BaseNature, Annotation) for each given Annotation.

Specified by:
processAnnotations in interface TargetAwareAnnotationProcessingService
Parameters:
info - the BaseNature (and so its PropertyHolder) that should be filled with the information read
annotations - the annotations to process
target - the target (AnnotatedElement) of the given annotation
Returns:
Annotation[] filled with unprocessed annotations
Throws:
AnnotationTargetException - if an annotation is used in a context that is not valid.
See Also:
TargetAwareAnnotationProcessingService.processAnnotations(org.castor.core.nature.BaseNature, java.lang.annotation.Annotation[], java.lang.reflect.AnnotatedElement)

processAnnotation

public <I extends BaseNature,A extends Annotation> boolean processAnnotation(I info,
                                                                             A annotation)
This method acts like it's super method, but also tries to process the annotation with the TargetAwareAnnotationProcessors. The processing action of this service. If an annotation is given which is not supported by this processor false is returned. Otherwise the Annotations specific processor will (try to) process the Annotation and the result of AnnotationProcessor.processAnnotation(BaseNature, Annotation) is returned.

Specified by:
processAnnotation in interface AnnotationProcessingService
Overrides:
processAnnotation in class BaseAnnotationProcessingService
Parameters:
info - the BaseNature (and so its PropertyHolder) that should be filled with the information read
annotation - the annotation to process
Returns:
true, if the annotation was processed, false if not
See Also:
BaseAnnotationProcessingService.processAnnotation(org.castor.core.nature.BaseNature, java.lang.annotation.Annotation)

processAnnotations

public <I extends BaseNature> Annotation[] processAnnotations(I info,
                                                              Annotation[] annotations)
This method acts like it's super method, but also tries to process the annotations with the TargetAwareAnnotationProcessors. Calls AnnotationProcessingService.processAnnotation(BaseNature, Annotation) for each given Annotation.

Specified by:
processAnnotations in interface AnnotationProcessingService
Overrides:
processAnnotations in class BaseAnnotationProcessingService
Parameters:
info - the BaseNature (and so its PropertyHolder) that should be filled with the information read
annotations - the annotations to process
Returns:
Annotation[] filled with unprocessed annotations
See Also:
org.castor.core.annotationprocessing.BaseAnnotationProcessingService#processAnnotations(org.castor.core.nature.BaseNature, java.lang.annotation.Annotation)


Copyright © 2012. All Rights Reserved.