net.vidageek.mirror.reflect
Class DefaultAnnotationHandler<T extends Annotation>

java.lang.Object
  extended by net.vidageek.mirror.reflect.DefaultAnnotationHandler<T>
All Implemented Interfaces:
AnnotationHandler<T>

public final class DefaultAnnotationHandler<T extends Annotation>
extends Object
implements AnnotationHandler<T>

This class is responsible for choosing where to reflect a single annotation.

Author:
dnfeitosa

Constructor Summary
DefaultAnnotationHandler(ReflectionProvider provider, Class<?> clazz, Class<T> annotation)
           
 
Method Summary
 T atClass()
          Use this method to reflect a single annotation at class
 T atField(String fieldName)
          Use this method to reflect a single annotation at field named fieldName
 MethodAnnotationHandler<T> atMethod(String methodName)
          Use this method to reflect a single annotation at method named methodName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAnnotationHandler

public DefaultAnnotationHandler(ReflectionProvider provider,
                                Class<?> clazz,
                                Class<T> annotation)
Method Detail

atField

public T atField(String fieldName)
Description copied from interface: AnnotationHandler
Use this method to reflect a single annotation at field named fieldName

Specified by:
atField in interface AnnotationHandler<T extends Annotation>
Parameters:
fieldName - name of the field from where to search for annotations.
Returns:
The annotation or null if it was not found.
See Also:
AnnotatedElementReflectionProvider.getAnnotation(Class)

atMethod

public MethodAnnotationHandler<T> atMethod(String methodName)
Description copied from interface: AnnotationHandler
Use this method to reflect a single annotation at method named methodName

Specified by:
atMethod in interface AnnotationHandler<T extends Annotation>
Parameters:
methodName - name of the method from where to search for annotations.
Returns:
An object responsible for reflecting annotations on a method.
See Also:
AnnotatedElementReflectionProvider.getAnnotation(Class)

atClass

public T atClass()
Description copied from interface: AnnotationHandler
Use this method to reflect a single annotation at class

Specified by:
atClass in interface AnnotationHandler<T extends Annotation>
Returns:
The annotation or null if it was not found.
See Also:
AnnotatedElementReflectionProvider.getAnnotation(Class)


Copyright © 2011 VidaGeek.net. All Rights Reserved.