public class MyFactoryBean implements FactoryBean {
private String myProperty;
public void setMyProperty(String myProperty) {
this.myProperty = myProperty;
}
@Override
public MyBean getObject() throws Exception {
return createBean();
}
public MyBean createBean(){
MyBean myBean = new MyBean();
myBean.setProperty(myProperty);
//下面 UserListener 调试时,UserListener 对象的类型是“MyFactoryBean$$Lambda$400/[email protected]”
UserListener[U] userListener=new UserListener[U](){
@Override
public void active(){
//doSomething
}
};
Cache.addUserListener(userListener);
return myBean;
}
@Override
public Class getObjectType() {
return MyBean.class;
}
@Override
public boolean isSingleton() {
return true;
}
}
MyFactoryBean$$Lambda$400/[email protected]
代理对象,请问有什么方式能直接得到该类具体的类型吗?除了把对象类型一并传过去
Cache.addUserListener(userListener,User1.class);