Hi Thomas,

there's hooks for unmarshalling that allow you to intervene with Castor's default unmarhalling behaviour. Have a look at the

UnmarshalListener

interface that allows you to deal with some situations. I am not sure, though, whether this will meet your requirements.

Cheers
Werner

On 20.01.2011 15:46, Swindells, Thomas wrote:
I'm using castor to simplify import of data into our system.
Currently the xml file contains a load of entities, each having an id, and uses 
refs so that entities can refer to each other without needing to be nested.

What I'd like to do is also have the ability to reference other objects which 
aren't in the xml file. (Eg are already in the database or perhaps some 
globals).

Ie if I do<Foo ref="123"/>  it will reference another entity with id "123" 
(current behaviour)
But if I do<Foo externalref="123"/>  it will call through to some code which can fetch 
object "123" and return it.

Is there any easy way to do this?
Thanks,

Thomas

________________________________

**************************************************************************************
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
[email protected] and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**************************************************************************************


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

   http://xircles.codehaus.org/manage_email


Reply via email to