users@jaxb.java.net

Re: Overiding default JAXB mappings

From: Roger Parkinson <roger_at_senanque.co.nz>
Date: Fri, 02 Oct 2009 13:47:30 +1300
I could use this too.
I had a recent performance issue with ArrayList, it goes slow as the size gets past a certain point.
Had to change it to a TreeSet (or similar, I forget the details).
It wasn't anywhere near JAXB so that was easy, but it might have been, in which case I would looking for an answer to this question.

Regards

rubinod wrote:
Hi,

I need something thread safe so even a Vector or something from
java.util.concurrent would be more useful.

Thanks


Wolfgang Laun-2 wrote:
  
This depends on PlatformType - is it an xs:simpleType?

What would you like to have instead of ArrayList, and why?

-W


On Wed, Sep 30, 2009 at 6:28 PM, rubinod <webaccounts@rubino.co.uk> wrote:

    
Hi,

Say I have the following:

<xs:element name="Platforms">
   <xs:complexType>
       <xs:sequence>
           <xs:element name="platform" minOccurs="0"
maxOccurs="unbounded"
type="c:PlatformType"/>
       </xs:sequence>
   </xs:complexType>
</xs:element>

when I run the schema through JAXB to generate the class files I get:

@XmlRootElement(name = "Platforms")
public class Platforms
   implements Serializable
{

   @XmlElement(name = "platform")
   protected List<Platform> platforms;

   public List<Platform> getPlatforms() {
       if (platforms == null) {
           platforms = new ArrayList<Platform>();
       }
       return this.platforms;
   }

}

I would like to be able to override the default List implementation as I
dont want an ArrayList- is this possible?

Thanks

--
View this message in context:
http://www.nabble.com/Overiding-default-JAXB-mappings-tp25684570p25684570.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@jaxb.dev.java.net
For additional commands, e-mail: users-help@jaxb.dev.java.net