1.定义一个注解:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface LogTag {
String level() default "info";
}
2.定义一个接口
public interface ITest {
void excuteBusiness();
}
3.定义一个代理类
/**
* 代理类
* @author chenshuai
* @version 1.0
*
*/
public class ProxyBean implements InvocationHandler {
private Object o;
/**
* @return the o
*/
private Object getO() {
return o;
}
/**
* @param o the o to set
*/
private void setO(Object o) {
this.o = o;
}
/**
* 创建代理
* @param obj
* @return
*/
public static <T&g
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface LogTag {
String level() default "info";
}
2.定义一个接口
public interface ITest {
void excuteBusiness();
}
3.定义一个代理类
/**
* 代理类
* @author chenshuai
* @version 1.0
*
*/
public class ProxyBean implements InvocationHandler {
private Object o;
/**
* @return the o
*/
private Object getO() {
return o;
}
/**
* @param o the o to set
*/
private void setO(Object o) {
this.o = o;
}
/**
* 创建代理
* @param obj
* @return
*/
public static <T&g