All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quincy.sdk.helper.AopHelper Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package com.quincy.sdk.helper;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

public class AopHelper {
	public static Method getMethod(JoinPoint joinPoint) throws NoSuchMethodException, SecurityException {
		MethodSignature methodSignature = (MethodSignature)joinPoint.getSignature();
		Class clazz = joinPoint.getTarget().getClass();
        return clazz.getMethod(methodSignature.getName(), methodSignature.getParameterTypes());
	}

	public static  T getAnnotation(JoinPoint joinPoint, Class annotationClass) throws NoSuchMethodException, SecurityException {
        return getMethod(joinPoint).getAnnotation(annotationClass);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy