Namespace Index Incorrect for custom marshallers
------------------------------------------------

         Key: JIBX-64
         URL: http://jira.codehaus.org/browse/JIBX-64
     Project: JiBX
        Type: Bug
  Components: core  
    Versions: CVS    
    Reporter: Chris Chen
    Priority: Minor


When a binding file contains custom marshaller and unmarshaller for a 
particular mapping in a specific namespace, the following is required:

1) The namespace must be declared globally, because
2) mappings with custom (un)marshallers cannot have child elements.

When the binding file contains mappings with these custom (un)marshallers, the 
generated code passes an index of 0 to the custom marshalling class's 
constructor.

Interestingly, if the mapping with the custom (un)marshallers is referenced in 
other mappings that do not use custom (un)marshallers, then the proper index 
for the namespace will be passed.

For instance,

<binding>
  <namespace uri="ns:a" default="elements"/>
  <mapping name="a" class="AClass" unmarshaller="AMapper" marshaller="AMapper" 
ns="ns:a"/>
</binding>

The generated code for the above binding file should pass index 2 to AMapper's 
constructor.  However, it does not.

In the following binding file,

<binding>
  <namespace uri="ns:a" default="elements"/>
  <mapping name="a" class="AClass" unmarshaller="AMapper" marshaller="AMapper" 
ns="ns:a"/>
  <mapping name="b" class="BClass">
    <structure field="a" usage="optional"/>
  </mapping>
</binding>

When the custom mapping (a) is referenced in another mapping, then this will 
produce the proper code.  The generated class will pass an index of 2 to 
AClass' constructor.


I am not entirely sure if this is the intended behavior.  If not, then this 
issue can be closed.

Thanks,
Chris

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
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://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to