code: public static <A extends Annotation> A getAnnotation(final Class<?> c, final Class<A> type)
     {
        A result = null;
        if (c != null)
        {
           result = getAnnotationFromType(c, type);
           if (result == null)
           {
              Class<?> superclass = c.getSuperclass();
              while (superclass != null)
              {
                 result = getAnnotation(superclass, type);
                 if (result != null)
                    break;
                 superclass = superclass.getSuperclass();
              }
           }
  
           if (result == null)
           {
              Class<?>[] interfaces = c.getInterfaces();
              for (Class<?> i : interfaces)
              {
                 result = getAnnotation(i, type);
                 if (result != null)
                    break;
              }
           }
        }
        return result;
     }
docs: Inspect class <b>c</b> for a specific <b>type</b> of annotation. This also discovers annotations defined through
  a @ {@link Stereotype}.
  
  @param c The class to inspect.
  @param type The targeted annotation class
  @return The annotation instance found on this class, or null if no matching annotation was found.