What happens if multiple converters can unmarshal xml?

∥☆過路亽.° 提交于 2019-12-13 21:00:35

问题


Imean that there might be two or more

XXXConverter extends ReflectionConverter

that might return true here

 public boolean canConvert(Class aClass)

for the same class


回答1:


Only one converter will be used for a class.

If you register multiple converters with the same priority, then the most recently registered one will be used.

Take a look at the source for DefaultConverterLookup.




回答2:


I guess they'd both convert it. But I guess the best answer would be to either look it up in the documentation, or just try it out.



来源:https://stackoverflow.com/questions/5077309/what-happens-if-multiple-converters-can-unmarshal-xml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!