基本类型的推土机自定义转换器
下面的网址有一个有关推土机自定义转换器的示例。
但是当我尝试该示例时,它给出了这样的异常..
类型:null Source父类:dozerPackage.Source 源字段名称:图像 源字段类型:类 java.util.ArrayList 源字段值:[www, eee] Dest父类:dozerPackage.Destination 目标字段名称:numOfImages 目标字段类型:int
org.dozer.MappingException:此自定义转换器(dozerPackage.TestCustomFieldConverter)不接受目标类型(int)!
有什么方法可以从推土机自定义返回原始类型转换器..
the below url has an example on dozer custom convertors..
but when i tried that example its giving the exception like this..
Type: null
Source parent class: dozerPackage.Source
Source field name: images
Source field type: class java.util.ArrayList
Source field value: [www, eee]
Dest parent class: dozerPackage.Destination
Dest field name: numOfImages
Dest field type: int
org.dozer.MappingException: Destination Type (int) is not accepted by this Custom Converter (dozerPackage.TestCustomFieldConverter)!
is there any way that i can return the primitive types from dozer custom convertors..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答是否定的。该功能尚未实现。请使用旧的 CustomConverter 接口而不是 DozerConverter 来实现所需的行为。
论坛主题在这里:
https://sourceforge.net/projects/dozer/forums/forum/ 452531/topic/3698691
跟踪功能请求位于此处:
https://sourceforge.net/tracker/? func=detail&aid=2997109&group_id=133517&atid=727371
The short answer is no. This feature is not yet implemented. Please use old CustomConverter interface instead of DozerConverter to achieve the desired behavior.
Forum thread is here:
https://sourceforge.net/projects/dozer/forums/forum/452531/topic/3698691
Feature Request for tracking is here:
https://sourceforge.net/tracker/?func=detail&aid=2997109&group_id=133517&atid=727371