Question

I am using dozer and I can't map from boolean to Boolean. What could be the problem?

mapping xhtml

<field>
    <a>test</a>
    <b is-accessible="true" >test2</b>
</field>

class a

private boolean test;

public boolean getTest(){
    return test;
}

class b

private Boolean test2;

public boolean isTest2(){
    return test2;
}
Was it helpful?

Solution

With dozer 5.4.0, the following worked for me

    <field>
        <a is-accessible="true" get-method="isFoo">foo</a>
        <b is-accessible="true" set-method="setFoo">foo</b>
    </field>

OTHER TIPS

According to the documentation on Dozer, this should be possible:

Data type coversion is performed automatically by the Dozer mapping engine. Currently, Dozer supports the following types of conversions: (these are all bi-directional)

  • Primitive to Primitive Wrapper
  • ...

You can try if specifying set-method and get-method helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top