java反射调用api

时间:2023-12-17 15:27:14

cglib的fastmethod

简单示例:

    FastClass serviceFastClass = FastClass.create(Person.class);

    Person p = new Person();

    p.setName("Tom");

    FastMethod serviceFastMethod = serviceFastClass.getMethod("display", new Class[]{String.class});

    Object returnValue = serviceFastMethod.invoke(p, new Object[]{"qazxsw"});

    System.out.println(returnValue);

java自带的反射调用

还有个:http://www.iteye.com/topic/1129340#