Hi Jon, The custom unmarshaller approach should be easy - just use a loop where you first check if the UnmarshallingContext is positioned at a start tag (so that you know when you've reached the end of the elements in the collection), then call the unmarshalElement() method to unmarshal the element. The example21 code int the tutorial of the distribution handles a hashmap structure, but you should be able to adapt it to your needs.
The other suggestion from Brian, of using a filtering iterator, could also work. Since you can't easily add this iterator directly to the PersistentSet you could instead hide the PersistentSet behind your own methods in the object that references the set - so you'd define add-method and iter-method methods *on the object that owns the set*, then hide the set implementation behind those methods (so the add-method would just delegate to the PersistentSet, while the iter-method would return a filtering iterator). The only part that's tricky is that the isNext() method of your filtering iterator would actually need to advance the wrapped PersistentSet iterator to see if there's another item to be marshalled. Those are the two approaches I can see. - Dennis Dennis M. Sosnoski SOA and Web Services in Java Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 Jon Kosmoski wrote: > Thanks for the ideas. I do need to go in both directions. But will try the > output only option to see if that works. > > I thought about an custom iterator, but apparently they have to live on the > collection being marshalled. > > It would be problematic to introduce this custom iterator on a PersistentSet. > I would have to create a custom > Hibernate collection user type and tell Hibernate to use that in all my > hibernate mapping files. > - Jon > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ jibx-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jibx-users
