org.spicefactory.cinnamon.config.annotation
Class AnnotationProcessor

java.lang.Object
  extended by org.spicefactory.cinnamon.config.annotation.AnnotationProcessor

public class AnnotationProcessor
extends Object

Processes Annotations on types and methods of a single class or interface and all its super-interfaces. Does not process superclasses. In Cinnamon this class will be used to process the @CinnamonService and @CinnamonMethod annotations on service interfaces.

Author:
Jens Halm

Constructor Summary
AnnotationProcessor(Class<?> annotatedClass, Class<? extends Annotation> classAnnotation, Class<? extends Annotation> methodAnnotation)
          Creates a new AnnotationProcessor.
 
Method Summary
 Map<Method,Annotation> getAnnotatedMethods()
          Returns a Map of annotated Methods and their associated annotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationProcessor

public AnnotationProcessor(Class<?> annotatedClass,
                           Class<? extends Annotation> classAnnotation,
                           Class<? extends Annotation> methodAnnotation)
Creates a new AnnotationProcessor.

Parameters:
annotatedClass - the annotated class that should be processed
classAnnotation - the Annotation to look for on the class declaration
methodAnnotation - the Annotation to look for on method declarations (may be the same as classAnnotation)
Method Detail

getAnnotatedMethods

public Map<Method,Annotation> getAnnotatedMethods()
Returns a Map of annotated Methods and their associated annotations. If the specified annotation is not present on a method, that method will only be included if the class annotation is present on the class or interface declaration. In that case the method will be mapped to the class annotation instead.

Returns:
a Map of Methods and their associated annotations