I have an XML input stream which I want to unmarshall.
Let's say it looks like this:

        <phone_book>
           <person number="555-1212"... />
           ...
                (about a million of these)
           ...
           <person ... />
        </phone_book>

However, I want to explicitly provide the top-level
object which corresponds to <phone_book>, rather than
simply put a class name in the mapping file.
I.e., what I want to do is have PhoneBook be an interface
and do something like this (fantasy code marked by ###):

        PhoneBook pb = new SomePhoneBookImpl();
        pb.setSomeAttr(...);
        pb.loginToSomeDirectoryDB(...);
        pb.doSomeOtherStuff(...);       

        Unmarshaller u = new Unmarshaller(myMappingFile);
  ###   u.setRootObject(pb);
        u.unmarshall(myPhoneBookInfoSource);

Is there any way to do this?  The key point it that
it must be done early; i.e., I need to be able to 
set up the PhoneBook object as I see fit before
the unmarshaller starts invoking setXXX/addXXX methods
on it to add the Person objects. 

TIA,

-- 
Eryq, http://www.zeegee.com/eryq 
WANTED:  Schrodinger's Cat.  Dead and/or Alive.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to