0
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に挿入する方法は?guiceによってMapオブジェクトを挿入する方法は?
'Person'フィールド' Map sons'に行タイプを使用していますか?もちろん汎用クラスの –
! –