Class BaseAnnotationProcessingService
- java.lang.Object
-
- org.castor.core.annotationprocessing.BaseAnnotationProcessingService
-
- All Implemented Interfaces:
AnnotationProcessingService
- Direct Known Subclasses:
BaseTargetAwareAnnotationProcessingService
public class BaseAnnotationProcessingService extends java.lang.Object implements AnnotationProcessingService
An AnnotationProcessingService handles multipleAnnotationProcessor
s and uses them to process one or moreAnnotation
s. 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
Constructors Constructor Description BaseAnnotationProcessingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotationProcessor(AnnotationProcessor annotationProcessor)
Add anAnnotationProcessor
to the service.java.util.Set<AnnotationProcessor>
getAnnotationProcessors()
Returns the set ofAnnotationProcessor
s registered with this service.<I extends BaseNature,A extends java.lang.annotation.Annotation>
booleanprocessAnnotation(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)
CallsAnnotationProcessingService.processAnnotation(BaseNature, Annotation)
for each given Annotation.
-
-
-
Method Detail
-
addAnnotationProcessor
public void addAnnotationProcessor(AnnotationProcessor annotationProcessor)
Add anAnnotationProcessor
to the service.- Specified by:
addAnnotationProcessor
in interfaceAnnotationProcessingService
- Parameters:
annotationProcessor
- theAnnotationProcessor
to add to this service.
-
getAnnotationProcessors
public java.util.Set<AnnotationProcessor> getAnnotationProcessors()
Returns the set ofAnnotationProcessor
s registered with this service.- Specified by:
getAnnotationProcessors
in interfaceAnnotationProcessingService
- Returns:
- A set of
AnnotationProcessor
s registered with this service.
-
processAnnotations
public <I extends BaseNature> java.lang.annotation.Annotation[] processAnnotations(I info, java.lang.annotation.Annotation[] annotations)
CallsAnnotationProcessingService.processAnnotation(BaseNature, Annotation)
for each given Annotation.- Specified by:
processAnnotations
in interfaceAnnotationProcessingService
- Parameters:
info
- theBaseNature
(and so itsPropertyHolder
) that should be filled with the information readannotations
- the annotations to process- Returns:
- Annotation[] filled with unprocessed annotations
- See Also:
AnnotationProcessingService.processAnnotation(BaseNature, Annotation)
-
processAnnotation
public <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 ofAnnotationProcessor.processAnnotation(BaseNature, Annotation)
is returned.- Specified by:
processAnnotation
in interfaceAnnotationProcessingService
- Parameters:
info
- theBaseNature
(and so itsPropertyHolder
) that should be filled with the information readannotation
- the annotation to process- Returns:
- true, if the annotation was processed, false if not
- See Also:
(BaseNature, Annotation)
-
-