Hi Ruben,

Ruben Fragoso wrote:

> Thank you Jorg for coming back to me
> 
> well i just wrote a bit of the code, to give an example
> 
> you can see the full example in this link
> 
> https://docs.google.com/open?id=0B8TCL6GRojyLbzVYckZ2cEpWOUE
> 
> so you can navigate without downloading it
> 
> it is very small project 8kb.
> 
> I would greatly appreciated if you gave a look

[snip]

>> > The problem is that the object that i  get in return is completly
>> > empty?
>> >
>> > Could please let me know what is wrong my my code?

================= %< ======================
MyCustomObject customObject = new MyCustomObject();
try {
  File file = new File("target" + File.separator + "test.xml");
  FileInputStream fis = new FileInputStream(file);
  xmlTransformer.fromXML(fis, customObject);
} catch (FileNotFoundException ex) {
}
================= %< ======================
    public Object unmarshal(HierarchicalStreamReader reader, 
UnmarshallingContext uc) {
        MyCustomObject returnValue = new MyCustomObject();
[snip]
        return returnValue;
    }

================= %< ======================

Because your converter uses a new MyCustomOject instead the one you have 
provided (uc.currentObject()) and your test method ignores the returned new 
instance. Actually you should never provide the root object for 
unmarshalling unless you really know what you're doing. The "Use with care!" 
hint in the javadoc is for a reason.

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to