Hi Linus,
I usually RTFM, but in this case, I completely missed any reference to a Jira. In fact, I just went back to SF, then to home page, and found nothing that led me to the CodeHaus link. But thanks. As you say, my complaint is covered.
David
Linus Kamb wrote:
I think Dennis is open to patches. I've seen others contribute.
This issue is in the jira (which is likely why there was no response):
http://jira.codehaus.org/browse/JIBX-48
On Dec 22, 2004, at 8:38 AM, David Ezzio wrote:
Hi Linus,
That was my conclusion as well. Not a real PITA, but definitely an inconvenience, and so far as I can tell, one that could be fixed.
I'm hoping that this project is more open to patches than to requests for insight.
Thanks,
David
Linus Kamb wrote:
Not exactly sure what you are looking for, but...
Yes, the signature for the collection add-method currently has to take an Object. Not too much of a pain, really. Just cast it to your particular class type and call the real method.
As to whether or not that will change in future releases, I don't know. Perhaps there is something in the jira on it.
On Dec 21, 2004, at 7:11 PM, David Ezzio wrote:
Linus KambWould love a response.
David Ezzio wrote:
Hi, Still wondering about this. Will JiBX do what I want it to do? David David Ezzio wrote:
-------------------------------------------------------Hi,
I still don't have the answer to my question. I am hoping that a change to the binding specification file will correct the problem that I am dealing with, but I don't know what the change should be.
I get the error message during enhancement, when the enhancer looks for a method Route.addFlight(Object). I would think it would be simple enough for it to look for Route.addFlight(Flight), but it doesn't.
TIA,
David
David Ezzio wrote:
Hi,
I've got JiBX working with a modified version of the TimeSchedule example. But I've got one issue that I would like some help with. All of my collection add methods must take an Object parameter type, when I would like them to take the element's type.
For example, here's what the relevant portions of the metadata look like:
<mapping class="jxml.Route" name="route" > <collection item-type="jxml.Flight" iter-method="iterateFlights" add-method="addFlight" /> <value ident="ref" style="attribute" name="from" get-method="getFrom" set-method="setFrom" /> <value ident="ref" style="attribute" name="to" get-method="getTo" set-method="setTo" /> </mapping> <mapping class="jxml.Flight" name="flight" > <value ident="ref" name="carrier" style="attribute" get-method="getCarrier" set-method="setCarrier" /> <value name="number" style="attribute" get-method="getNumber" set-method="setNumber" /> <value name="depart" style="attribute" get-method="getDepart" set-method="setDepart"/> <value name="arrive" style="attribute" get-method="getArrive" set-method="setArrive" /> </mapping>
Here's what the data file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<schedule>
<carriers>
<carrier code="NL">
<url>http://www.northleft.com</url>
<name>Northleft Airlines</name>
</carrier>
<carrier code="CL">
<url>http://www.classyskylines.com</url>
<name>Classy Skylines</name>
</carrier>
</carriers>
<airports>
<airport code="BOS">
<location>Boston, MA</location>
<name>Logan International Airport</name>
</airport>
<airport code="SEA">
<location>Seattle, WA</location>
<name>Seattle-Tacoma International Airport</name>
</airport>
<airport code="LAX">
<location>Los Angeles, CA</location>
<name>Los Angeles International Airport</name>
</airport>
</airports>
<routes>
<route from="BOS" to="SEA">
<flight carrier="CL" number="796" depart="4:12a" arrive="1:26a"/>
<flight carrier="NL" number="328" depart="2:54a" arrive="1:29a"/>
<flight carrier="CL" number="401" depart="4:12a" arrive="1:25a"/>
</route>
<route from="SEA" to="BOS">
<flight carrier="CL" number="634" depart="7:43a" arrive="9:13a"/>
<flight carrier="NL" number="508" depart="4:38p" arrive="6:12p"/>
<flight carrier="CL" number="687" depart="1:38p" arrive="3:08p"/>
</route>
</routes>
</schedule>
And here's what the relevant portion of the Route class looks like:
package jxml;
public class Route { private Airport from; private Airport to; private ArrayList flightList = new ArrayList();
public Route(ArrayList flightList, Airport from, Airport to) { ... }
public void addFlight(Flight flight) { ... }
public Iterator iterateFlights() { ... }
public Airport getFrom() { ... }
public void setFrom(Airport from) { ... }
public Airport getTo() { ... }
public void setTo(Airport to) { ... }
protected Route() { ... } }
If I enhance as is, I get the following error message:
org.jibx.runtime.JiBXException: Add method addFlight not found in collection type jxml.Route at tag "collection"(line 26, col 95, in jxml/binding.xml)
at org.jibx.runtime.impl.UnmarshallingContext.throwStartTagException( Un marshallingContext.java:2725)
at org.jibx.binding.def.BindingBuilder.unmarshalStructure(BindingBuil de r.java:1153)
at org.jibx.binding.def.BindingBuilder.unmarshalStructureChildren(Bin di ngBuilder.java:837)
at org.jibx.binding.def.BindingBuilder.unmarshalMapping(BindingBuilde r. java:1531)
at org.jibx.binding.def.BindingBuilder.unmarshalMappings(BindingBuild er .java:963)
at org.jibx.binding.def.BindingBuilder.unmarshalBindingDefinition(Bin di ngBuilder.java:1597)
at org.jibx.binding.Utility.loadBinding(Utility.java:228)
at org.jibx.binding.Utility.loadFileBinding(Utility.java:254)
at org.jibx.binding.Compile.compile(Compile.java:291)
at org.jibx.binding.Compile.main(Compile.java:367)
On the other hand, if I change the parameter of addFlight to "Object flight" everything is fine.
Is it possible to configure so that the parameter type of addFlight is Flight?
Thanks,
David Ezzio
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
[EMAIL PROTECTED]
(206) 547-0393 x106
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
Linus Kamb [EMAIL PROTECTED] (206) 547-0393 x106
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
