commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikram Goyal" <t...@craftbits.com>
Subject Re: [betwixt] root Collections?
Date Sat, 19 Mar 2005 23:52:43 GMT
Hi Jeremy,

I am not sure what you mean. Is addressBook a collection of Person objects?

 java.util.ArrayList addressBook = new java.util.ArrayList();
 addressBook.add(new Person("Bob"));
 addressBook.add(new Person("John"));
 bWriter.write("addressBook", addressBook);
 bWriter.flush();

This should do what you want to do, if I understand you correctly.

Otherwise, if you can make your Addressbook a class with a addPerson() 
method that adds new Person objects to an internal collection, it will give 
you better (and more configurable) results. You can also use the .betwixt 
file to override default behaviors.

BTW, there are several books on Commons now available (including mine!): 
http://wiki.apache.org/jakarta-commons/JakartaCommonsResources

HTH,
Vikram

---------------------------------------------------------------------------------------
Jakarta Commons Online Bookshelf
Module 5: JXPath and Betwixt: 
http://www.manning.com/catalog/view.php?book=goyal5
All Modules: http://www.manning.com/goyal
---------------------------------------------------------------------------------------

----- Original Message ----- 
From: "Jeremy Denton" <majeric@gmail.com>
To: <commons-user@jakarta.apache.org>
Sent: Sunday, March 20, 2005 5:09 AM
Subject: [betwixt] root Collections?


>
> Is there any way of specifying root collections in betwixt?
>
> <addressBook>
> <person name="bob"/>
> <person name="joe"/>
> <person name="frank/">
> <person name="jim"/>
> </addressBook >
>
>
> The documentation for Betwixt is a bit lacking. (I'll happily contribute 
> to the Wiki once I figure out how to use it myself).
>
> Otherwise, I'm pleased by the project. There are very few XML Binding 
> frameworks that leaves your Beans alone.
>
> Cheers,
> Jeremy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message