I don't think that example will work in my situation. In the example, the map elements that needs to be marshalled/unmarshalled are nested within a <map> element. This allows a marshaller/unmarshaller to be mapped to the <map> container element which only contains the map elements and nothing more.
In my situation, the map elements do not have a container around them. So if I were to write a custom marshaller/unmarshaller it would have to be mapped at the <ItemDetail> level and would have to handle not only the <Extrinsic> elements but all of <ItemDetail>'s elements. Correct? --Norm -- Norm Deane MIS Consultant Vanderbilt University (615) 322-7855 [EMAIL PROTECTED] > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Dennis Sosnoski > Sent: Friday, May 14, 2004 11:03 AM > To: [EMAIL PROTECTED] > Cc: 'Chet Rogers'; 'Brian Murray' > Subject: Re: [jibx-users] Support for Map using <collection> > > > You should be able to just use a custom > marshaller/unmarshaller for the > Map itself. That won't use your get/set methods for the individual > items, but I don't see any reason why you'd want to. > > The custom marshaller/unmarshaller documented at > http://jibx.sourceforge.net/tutorial/binding-custom.html#marunmar > handles String keys with arbitrary object values (which must > have their > own <mapping> definitions). Changing this sample code > (included in the > /build/extras tree) to work with String values is simple. It > sounds like > that will give you exactly what you need. > > - Dennis > > Norm Deane wrote: > > >Is there any way to take this structure... > > > > <ItemDetail> > > <!-- some other elements here --> > > > > <Extrinsic name="ExtName1">Ext text 1</Extrinsic> > > <Extrinsic name="ExtName2">Ext text 2</Extrinsic> > > <Extrinsic name="ExtName3">Ext text 3</Extrinsic> > > </ItemDetail> > > > >and map it into a structure like this... > > > > public class ItemDetail > > { > > // properties for other elements in ItemDetail > > private Map extrinsics = new HashMap(); > > > > public void setExtrinsics(String key, String value) { > >extrinsics.put(key,value); } > > public String getExtrinsics(String key) { > (String)extrinsics.get(key); > >} > > } > > > >It seems that this could be done with <collection> if it > supported maps > >but it doesn't. Writing a custom Marshaler/UnMarshaller > isn't really > >an option because the ItemDetail element contains many other nested > >elements that I don't want to have to deal with. > > > >--Norm > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ jibx-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jibx-users
