class Person{
Map sons;
Map getSons(){
return sons;
}
}
class Test{
public void Main(){
Person p=new Person();
Map sons=new HashMap<String,Person>();
sons.add("jack",new Person());
..... // here use guice to inject this Map object to p,how to do it?
System.out.print(new Person().getSons().count());
}
}
就像代码显示的那样,如何通过 guice 将现有的 Map 对象注入到 bean 中?