Here you can find the source of getAnnotationFromJoinpointMethod(ProceedingJoinPoint joinpoint, Class annotationClass)
@SuppressWarnings({ "rawtypes", "unchecked" }) public static Annotation getAnnotationFromJoinpointMethod(ProceedingJoinPoint joinpoint, Class annotationClass) throws SecurityException, NoSuchMethodException
//package com.java2s; //License from project: Apache License import java.lang.annotation.Annotation; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.reflect.MethodSignature; public class Main { @SuppressWarnings({ "rawtypes", "unchecked" }) public static Annotation getAnnotationFromJoinpointMethod(ProceedingJoinPoint joinpoint, Class annotationClass) throws SecurityException, NoSuchMethodException { MethodSignature signature = (MethodSignature) joinpoint.getSignature(); String methodName = signature.getMethod().getName(); Class<?>[] parameterTypes = signature.getMethod().getParameterTypes(); Annotation annotation = joinpoint.getTarget().getClass().getMethod(methodName, parameterTypes) .getAnnotation(annotationClass); return annotation; }/*from w w w.j a v a 2s .c om*/ }