[ 
http://jira.codehaus.org/browse/JIBX-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=140028#action_140028
 ] 

Jon Little commented on JIBX-224:
---------------------------------

Having implemented the pre-scribed way to unmarshall to an already instantiated 
object I really really do not like having an uncondityional cast in my code:

  /**
   * @see 
org.apache.struts2.rest.handler.ContentTypeHandler#toObject(java.io.Reader, 
java.lang.Object)
   */
  public void toObject(Reader in, Object target)
  {
    init();
    
    try
    {
      IUnmarshallingContext umc = bf.createUnmarshallingContext();
      umc.setDocument(in);
      // This un-conditional cast is the current way that JibX unmarshalls to an
      // already instantiated object - YUCK
      ((IUnmarshallable)target).unmarshal(umc);
    }
    catch (JiBXException e)
    {
      log.error("Problem while unmarshalling XML to an object");
      log.error(e.getMessage());
      log.error(e.getStackTrace());
    }
  }

Therefore I would really like to see my new methods added to the context API.

BTW, I did have an instanceof test but that failed for reasons that I could 
only deduce to how the byte code is altered

> Ability to unmarshall to an already instantiated object
> -------------------------------------------------------
>
>                 Key: JIBX-224
>                 URL: http://jira.codehaus.org/browse/JIBX-224
>             Project: JiBX
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jon Little
>            Assignee: Dennis Sosnoski
>         Attachments: IUnmarshallingContext.java, UnmarshallingContext.java
>
>
> Adid the ability to  unmarshall to an already instantiated object.
> This is particularly useful for the Struts2 RESTful plug in.

-- 
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

        

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to