org.castor.core.annotationprocessing
Class BaseAnnotationProcessingService

java.lang.Object
  extended by org.castor.core.annotationprocessing.BaseAnnotationProcessingService
All Implemented Interfaces:
AnnotationProcessingService
Direct Known Subclasses:
JPAClassAnnotationProcessingService, JPAFieldAnnotationProcessingService

public class BaseAnnotationProcessingService
extends java.lang.Object
implements AnnotationProcessingService

An AnnotationProcessingService handles multiple AnnotationProcessors and uses them to process one or more Annotations. This is a standard implementation that should be sufficient for most purposes.

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

Constructor Summary
BaseAnnotationProcessingService()
           
 
Method Summary
 void addAnnotationProcessor(AnnotationProcessor annotationProcessor)
          Add an AnnotationProcessor to the service.
 java.util.Set<AnnotationProcessor> getAnnotationProcessors()
          Returns the set of AnnotationProcessors registered with this service.
<I extends BaseNature,A extends java.lang.annotation.Annotation>
boolean
processAnnotation(I info, A annotation)
          The processing action of this service.
<I extends BaseNature>
java.lang.annotation.Annotation[]
processAnnotations(I info, java.lang.annotation.Annotation[] annotations)
          Calls AnnotationProcessingService.processAnnotation(BaseNature, Annotation) for each given Annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseAnnotationProcessingService

public BaseAnnotationProcessingService()
Method Detail

addAnnotationProcessor

public final void addAnnotationProcessor(AnnotationProcessor annotationProcessor)
Add an AnnotationProcessor to the service.

Specified by:
addAnnotationProcessor in interface AnnotationProcessingService
Parameters:
annotationProcessor - the AnnotationProcessor to add to this service.
See Also:
addAnnotationProcessor(AnnotationProcessor)

getAnnotationProcessors

public java.util.Set<AnnotationProcessor> getAnnotationProcessors()
Returns the set of AnnotationProcessors registered with this service.

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

processAnnotations

public final <I extends BaseNature> java.lang.annotation.Annotation[] processAnnotations(I info,
                                                                                         java.lang.annotation.Annotation[] annotations)
Calls AnnotationProcessingService.processAnnotation(BaseNature, Annotation) for each given Annotation.

Specified by:
processAnnotations in interface AnnotationProcessingService
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:
processAnnotations(BaseNature, Annotation[])

processAnnotation

public final <I extends BaseNature,A extends java.lang.annotation.Annotation> boolean processAnnotation(I info,
                                                                                                        A annotation)
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
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:
(BaseNature, Annotation)


Copyright © 2011. All Rights Reserved.