I also have a requirement to create an instance of an object with an element
node as a parameter to the constructor. I know version 0.9.5 has
capabilities to specify an attribute-mapped element as an argument to the
constructor. This is documented in the Castor website.

I searched the archives and saw that there is a workaround for constructors
with arguments (for elements). The workaround mentions using a Wrapper
Object and Field Handler.

Can someone post an example of how to do this?

Christine Rodriguez
 
-----Original Message-----
From: David Kocher [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 8:11 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] marshaller calls constructor

Hi castor users,        
        I would like to write some objects to an xml which do not have a
constructor 
with no arguments.

>From castor I get the following exception:
        org.exolab.castor.mapping.MappingException: The Java class
ch.itserve.MyClass              
        is not constructable -- it does not contain a default public
constructor

Why does castor attempt to make new instances of the class? I assumed all it

needs to to is fetching the values with the getter methods. 

Thanks for clarification!
- David

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

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

Reply via email to