How to Convert ArrayList<Object> to a XML using JAXB?

前端 未结 1 845
日久生厌
日久生厌 2021-01-24 20:33

I am trying to convert ArrayList to xml using JAXB..

ArrayList myList = new ArrayList();

    myList = retrieveUserAttributes.get         


        
相关标签:
1条回答
  • 2021-01-24 21:30

    Try to create a class that wraps your list and make it a xml root, e.g.:

    @XmlRootElement
    class LDAPUsers {
        private List<LDAPUser> users;
        ... get ... set ... constructor 
    }
    

    Then marshal LDAPUsers object.

    0 讨论(0)
提交回复
热议问题