문제

I am using Dozer mapper to map Service objects to Value objects. I am mapping the date by means of the following:

<mapping date-format="dd-MM-yyyy">
  <class-a>MySo</class-a>
  <class-b>MyVO</class-b>
  <field>
    <a>dateStr</a>
    <b>dateObj</b>
  </field>
</mapping>

However, I need to specify the format for the date each time. Is there some other approach to map string date directly?

도움이 되었습니까?

해결책

In dozer.xml we can specify some default configuration.

for eg.

<configuration>
    <stop-on-errors>true</stop-on-errors>
    <date-format>dd-MM-yy</date-format>
    <wildcard>true</wildcard>
</configuration>

here is Link to refer.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top