• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB. order of items in List  RSS feed

 
Alexander V Fahrmann
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, ranchers. Could oneone give me a reference to some official/reliable source to find answer for the following question?

the following particle of a schema document:

<element name="name" type="SomeType" maxOccurs="unbounded" />

will be bound to:

List<SomeType> name;

So, the question is: is it ensured/guaranteed that items are placed in the List in the same order as them appear in the corresponding XML document?
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alexander,

I think you have to customize the binding with annotations to your schema. Take a look at Sun's webservices tutorial!

There's an attribute "collectionType" where you can give any collection which implements java.util.List. Just take a list implementation which guarantees ordering

Marco
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!