Interface IAnnotationFinder

  • All Known Implementing Classes:
    JDK15AnnotationFinder

    public interface IAnnotationFinder
    This interface defines how annotations are found on classes, methods and constructors. It will be implemented by both JDK 1.4 and JDK 5 annotation finders.
    • Method Detail

      • findAnnotation

        <A extends IAnnotation> A findAnnotation​(java.lang.Class<?> cls,
                                                 java.lang.Class<A> annotationClass)
        Parameters:
        cls - - The corresponding class.
        annotationClass - - The class on which annotation is to be looked for.
        Returns:
        The annotation on the class or null if none found.
      • findAnnotation

        <A extends IAnnotation> A findAnnotation​(java.lang.reflect.Method m,
                                                 java.lang.Class<A> annotationClass)
        Parameters:
        m - - The corresponding Method
        annotationClass - - The class on which annotation is to be looked for.
        Returns:
        The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.
      • findAnnotation

        <A extends IAnnotation> A findAnnotation​(java.lang.Class<?> clazz,
                                                 java.lang.reflect.Method m,
                                                 java.lang.Class<A> annotationClass)
      • findAnnotation

        <A extends IAnnotation> A findAnnotation​(java.lang.reflect.Constructor<?> cons,
                                                 java.lang.Class<A> annotationClass)
        Parameters:
        cons - - The corresponding Constructor
        annotationClass - - The class on which annotation is to be looked for.
        Returns:
        The annotation on the method. If not found, return the annotation on the declaring class. If not found, return null.
      • hasTestInstance

        boolean hasTestInstance​(java.lang.reflect.Method method,
                                int i)
        Returns:
        true if the ith parameter of the given method has the annotation @TestInstance.
      • findOptionalValues

        java.lang.String[] findOptionalValues​(java.lang.reflect.Method method)
        Returns:
        the @Optional values of this method's parameters (null if the parameter isn't optional)
      • findOptionalValues

        java.lang.String[] findOptionalValues​(java.lang.reflect.Constructor ctor)
        Returns:
        the @Optional values of this method's parameters (null if the parameter isn't optional)