com.zusmart.sample.interceptor.FormaterInterceptor Maven / Gradle / Ivy
The newest version!
package com.zusmart.sample.interceptor;
import java.lang.reflect.Method;
import com.zusmart.inject.annotation.Component;
import com.zusmart.inject.annotation.Interceptor;
import com.zusmart.inject.interceptor.InterceptorFactory;
@Component
@Interceptor("com.zusmart.sample.kit.Formater")
public class FormaterInterceptor extends InterceptorFactory{
@Override
protected void onBefore(Class> targetClass, Method targetMethod, Object[] arguments) throws Throwable {
System.err.println("拦截器开始拦截 ->" + targetMethod.getName());
}
@Override
protected void onAfter(Class> targetClass, Method targetMethod, Object[] arguments, Object result) throws Throwable {
System.err.println("拦截器结束拦截 ->" + targetMethod.getName());
}
}