users@jaxb.java.net

j2s annotating, class extends ArrayList

From: J. Barde <jacob.barde_at_swri.org>
Date: Mon, 07 Apr 2008 09:50:56 -0500

I'm trying to annotate some java classes that we have in a pre-existing
framework, and am having difficulty in mapping the container class
(AppUsers) so that JAXB will properly export its contents.

After populating AppUsers, and then marshalling an instance, I only get
the following result:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<appUsers/>

When I expect it should be:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<appUsers>
    <appUser ..../>
    <appUser ..../>
    <!-- repeated as necessary for all AppUser objects in AppUsers -->
</appUsers>


Any help would be appreciated.

@XmlRootElement
@XmlType
public class AppUser {
    // attrib annotations on properties
}


@XmlRootElement
@XmlType
public class AppUsers extends ArrayList<AppUser> {
    void populate(RowSet rs) {
        //populate using this.add(new AppUser(...));
    }
}


-- 
J. Barde
Research Analyst
Southwest Research Institute
Training, Simulation and Performance Improvement