Code:
<bean id="myCar" class="my.company.Car">
<property name="properties">
<list>
<bean class="my.company.Property">
<constructor-arg index="0" value="type"/>
<constructor-arg index="1" value="MPV"/>
</bean>
<bean class="my.company.Property">
<constructor-arg index="0" value="numberOfDoors"/>
<constructor-arg index="1" value="4"/>
</bean>
</list>
</property>
<property name="familyCar" value="true"/>
</bean>
with the following classes:
Code:
class Car {
private Collection<Property> properties;
private boolean familyCar;
public void setProperties(final Collection<Property> properties) {
this.properties = properties;
}
public void setFamilyCar(final boolean familyCar) {
this.familyCar = familyCar;
}
}
and
Code:
class Property {
private final String name;
private final String value;
public Property(final String name, final String value) {
this.name = name;
this.value = value;
}
}
You really need to read the samples