I have a problem with a test-method not being included in the generated
binding code.
The two bindings below are (I think) equivalent. The first has a named element
called "name" that is optional and has a test-method to determine marshalling
behavior. The second has an unnamed structure with a test-method that
contains a named structure for the "name" element.
Unfortunately in the second case no code is generated to call the hasName()
method. I suppose this sort of makes sense as the unnamed structure doesn't
marshall to an element but the contained structures/values do and should not
be used if hasName() returns false.
binding1:
<binding>
<mapping name="customer" class="ognl.Customer1">
<structure name="name" usage="optional" test-method="hasName">
<value name="first-name" field="firstName" usage="optional"/>
<value name="last-name" field="lastName" usage="optional"/>
</structure>
<value name="street1" field="street1"/>
<value name="city" field="city"/>
<value name="state" field="state"/>
<value name="zip" field="zip"/>
<value name="phone" field="phone"/>
</mapping>
</binding>
binding2:
<binding>
<mapping name="customer" class="ognl.Customer1">
<structure usage="optional" test-method="hasName">
<structure name="name">
<value name="first-name" field="firstName" usage="optional"/>
<value name="last-name" field="lastName" usage="optional"/>
</structure>
</structure>
<value name="street1" field="street1"/>
<value name="city" field="city"/>
<value name="state" field="state"/>
<value name="zip" field="zip"/>
<value name="phone" field="phone"/>
</mapping>
</binding>
--
Brian Wallis
Object Consulting http://www.objectconsulting.com.au/
level 5, 451 little bourke street, melbourne VIC 3000
+61 411 332712
-------------------------------------------------------------------------
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