Mapping dozer.xml中的日期格式配置
我正在使用Dozer mapper将服务对象映射到值对象。我通过以下方式映射日期:Mapping dozer.xml中的日期格式配置,mapping,dozer,xml-configuration,Mapping,Dozer,Xml Configuration,我正在使用Dozer mapper将服务对象映射到值对象。我通过以下方式映射日期: <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 date-format="dd-MM-yyyy">
<class-a>MySo</class-a>
<class-b>MyVO</class-b>
<field>
<a>dateStr</a>
<b>dateObj</b>
</field>
</mapping>
迈索
MyVO
dateStr
dateObj
但是,每次我都需要指定日期的格式。是否有其他方法可以直接映射字符串日期?在dozer.xml中,我们可以指定一些默认配置 例如
<configuration>
<stop-on-errors>true</stop-on-errors>
<date-format>dd-MM-yy</date-format>
<wildcard>true</wildcard>
</configuration>
真的
年月日
真的
这里是参考