Can JAXB output an ArrayList as comma separated values?

前端 未结 3 1069
臣服心动
臣服心动 2021-01-19 07:56

I have something like

@XmlElementWrapper(name=\"Mylist\")
List myItems = new ArrayList()

and that comes out lik

3条回答
  •  -上瘾入骨i
    2021-01-19 08:34

    You can use @XmlList to make it a space separated value.

    For a comma separated list you will need to use an XmlAdapter. For more information on XmlAdapter see:

    • http://bdoughan.blogspot.com/2010/07/xmladapter-jaxbs-secret-weapon.html

提交回复
热议问题