Here you can find the source of getMethod(Class> compClassOrSuper, Class extends Annotation> annotation)
Parameter | Description |
---|---|
compClassOrSuper | a parameter |
annotation | a parameter |
private static Method getMethod(Class<?> compClassOrSuper, Class<? extends Annotation> annotation)
//package com.java2s; //License from project: LGPL import java.lang.annotation.Annotation; import java.lang.reflect.Method; public class Main { /**/*w w w. j a va 2 s. c om*/ * Checks for annotation of the class * @param compClassOrSuper * @param annotation * @return */ private static Method getMethod(Class<?> compClassOrSuper, Class<? extends Annotation> annotation) { for (Method m : compClassOrSuper.getMethods()) { if (m.getAnnotation(annotation) != null) { return m; } } return null; } }