Reputation: 363
How to invoke 2 parameters setter in spring bean? I know that's work with constructor, but imagine that I have method void setMyFoo(int i, boolean b);
.
How can I call it from xml?
<property name="MyFoo">
//what should be there ????
</property>
Upvotes: 1
Views: 1175
Reputation: 7196
According to java bean convention,a setter with two parameter is not a setter.Setter and getter are related to only one property at a time.
However if you want,your setter to contains multiple vales ,you can use map or list as a properties which further contains other(primitives).
Upvotes: 1
Reputation: 279990
You can't. Properties are expected to have a corresponding setter method with a single parameter.
Upvotes: 1