jibx如何绑定集合
我需要使用 Jibx 将以下 XML 字符串映射到一个对象:
<Domains>
<DomainName>fdfsdfdsfds</DomainName>
<DomainName>fdfsdfdsfds</DomainName>
<DomainName>fdfsdfdsfds</DomainName>
</Domains>
我认为以下类映射了上面的内容:
public class Domains{
List<String> domainNames;
}
我似乎无法使用 Jibx 正确映射它。有谁知道如何执行上述操作?
I need to map the following XML string to an object using Jibx:
<Domains>
<DomainName>fdfsdfdsfds</DomainName>
<DomainName>fdfsdfdsfds</DomainName>
<DomainName>fdfsdfdsfds</DomainName>
</Domains>
I think the following class maps the above:
public class Domains{
List<String> domainNames;
}
I cant seem to get this to map correctly using Jibx. Does anyone know how to do the above?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JiBX 文档在这里解释了如何使用集合:
使用集合。
您的问题可能出在您的绑定定义文件中。
binding.xml 文件中的集合定义应如下所示:
The JiBX documentation explains how to use collections here:
Working with collections.
Your problem is probably in your binding definition file.
The collection definition in your binding.xml file should read like this: