Your setter/getter has to be of the same type with the internal field.
You can however have a setprivate Map exchangeCodes ;
public Map getExchangeCodes() {
return exchangeCodes;
}
but then you have to transform the map into a set. You can do this by using a factory-method inside Spring xml:private Set exchangeCodes;
public Set getExchangeCodes() {
return exchangeCodes.keySet();
}
Code:<bean id="properties.factory" class="org.springframework.beans.factory.config.PropertiesFactoryBean> <property name="location" value="classpath:myValues.properties"/> </bean> ... <property name="exchangeCodes"> <bean factory-bean="propertiesFactory" factory-method="keySet"/></property>


Reply With Quote