Re: [jibx-users] Maps

2013-07-22 Thread Archie Cobbs
You can't use put as an add method because the add method must take only
one argument.

But the larger issue is that JiBX doesn't support Maps out of the box.

FYI I wrote a helper class to facilitate solving this problem... see
MapEntry.javahttp://dellroad-stuff.googlecode.com/svn/trunk/publish/reports/javadoc/index.html?org/dellroad/stuff/jibx/MapEntry.html.
Basically you trick JiBX into thinking each key-value pair is an element in
a collection.

-Archie

On Mon, Jul 22, 2013 at 11:43 AM, Furst, Carl carl.fu...@mlb.com wrote:

 So I'm trying to marshal/unmarshal a HashMap and I get the following error
 when I compile the jibx xml:

 Error: add-method put not found in class java.util.Map; on collection
 element at (line 12, col 283, in DepthChart.xml)


 Which we know it is. If I take out the add-method declaration, it throws
 another error saying I need an add-method or store-method.

 Any ideas as to what I'm doing wrong?

 I'm using Jibx 1.1 and I'm guessing that Jibx doesn't support the use of
 Maps? I noticed that you needed extra jars for this.

 Is that correct? If so, I suggest you put something explicit in your docs.
 For there is nothing that says Jibx does not support Maps. Only that it
 does support Collections (which I think a Map would be such a thing).

 Many thanks,
 Carl Furst






 **

 MLB.com: Where Baseball is Always On



 --
 See everything from the browser to the database with AppDynamics
 Get end-to-end visibility with application monitoring from AppDynamics
 Isolate bottlenecks and diagnose root cause in seconds.
 Start your free trial of AppDynamics Pro today!
 http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
 ___
 jibx-users mailing list
 jibx-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jibx-users




-- 
Archie L. Cobbs
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Maps

2013-07-22 Thread Furst, Carl
Thanks, Archie, that's what I thought. I'll look into those helper classes!

Thanks again!
Carl Furst






From:  Archie Cobbs arc...@dellroad.org
Reply-To:  JiBX users jibx-users@lists.sourceforge.net
Date:  Monday, July 22, 2013 12:52 PM
To:  JiBX users jibx-users@lists.sourceforge.net
Subject:  Re: [jibx-users] Maps



You can't use put as an add method because the add method must take only
one argument.

But the larger issue is that JiBX doesn't support Maps out of the box.

FYI I wrote a helper class to facilitate solving this problem... see
MapEntry.java 
http://dellroad-stuff.googlecode.com/svn/trunk/publish/reports/javadoc/in
dex.html?org/dellroad/stuff/jibx/MapEntry.html. Basically you trick JiBX
into thinking each key-value pair is an element in a collection.

-Archie

On Mon, Jul 22, 2013 at 11:43 AM, Furst, Carl
carl.fu...@mlb.com wrote:

So I'm trying to marshal/unmarshal a HashMap and I get the following error
when I compile the jibx xml:

Error: add-method put not found in class java.util.Map; on collection
element at (line 12, col 283, in DepthChart.xml)


Which we know it is. If I take out the add-method declaration, it throws
another error saying I need an add-method or store-method.

Any ideas as to what I'm doing wrong?

I'm using Jibx 1.1 and I'm guessing that Jibx doesn't support the use of
Maps? I noticed that you needed extra jars for this.

Is that correct? If so, I suggest you put something explicit in your docs.
For there is nothing that says Jibx does not support Maps. Only that it
does support Collections (which I think a Map would be such a thing).

Many thanks,
Carl Furst






**

MLB.com: Where Baseball is Always On


--

See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktr
k
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users






-- 
Archie L. Cobbs






**

MLB.com: Where Baseball is Always On
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users