goncharov-ns / jodconverter

Automatically exported from code.google.com/p/jodconverter
0 stars 0 forks source link

Improving spring support #117

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What I'd like to be able to do with spring :

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:task="http://www.springframework.org/schema/task" 
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">

    <bean id="officeManagerConfiguration" class="org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration">
        <property name="portNumber" value="2003" />
    </bean>

    <bean id="officeManager" factory-bean="officeManagerConfiguration" factory-method="buildOfficeManager"/>
</beans>

The problem is that DefaultOfficeManagerConfiguration is not a java bean : no 
getter associated to the "setters" (and setters should return void but this not 
a problem for spring).

=> org.springframework.beans.NotWritablePropertyException: Invalid property 
'portNumber' of bean class 
[org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration]: Bean 
property 'portNumber' is not writable or has an invalid setter method. Does the 
parameter type of the setter match the return type of the getter?

At the moment, we are required to have a 
SpringDefaultOfficeManagerConfiguration with "proper" getters and setters that 
also have a build method which delegtes to DefaultOfficeManagerConfiguration.

The only thing necessary is to add getters so I htink this can be done directly 
inside jod.

Original issue reported on code.google.com by c.blin.y...@gmail.com on 7 Apr 2014 at 2:38