I am trying to clean up the attribute cross-checking for beta 4, so that all contradictory or inappropriate attributes will be reported as errors. That should eliminate this type of problem in the future. For now, it can certainly be painful.

 - Dennis

Gareth wrote:

I just had something like this cause me to rip some hair out, not sure if its the same problem but:

Suppose we have some fancy class ThingFoo that you want to bind to a field, but you DONT want the binding
compiler to mess with its byte code (perhaps you want to use it in several independent binding files). So you wrap
access to an instance of ThingFoo in a containing class, ThingBar, by correctly defining set & get methods in your code:


class ThingBar {
   private ThingFoo foo;
   public ThingBar(){...}
   void setFoo(String stringOfFoo) {...}
   String getFoo(){...}
}

Now JiBX will actually do different things with this depending on how you bind that field:
1.)
<value name="foo" field="foo" get-method="getFoo" set-method="setFoo"/>
This binding causes ClassCastExceptions for me. It seems to ignore the set and get methods.


2.)
   <value name="foo" get-method="getFoo" set-method="setFoo"/>
Notice field="foo" is gone! This version works just fine. :-)

Perhaps there should be something in the parser to check for this? If your binding is as in the first case it should say
"field and set/get are mutually exclusive".


-- Gareth






-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to