Thank you.
From: Keith Visco <[EMAIL PROTECTED]> Reply-To: <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [castor-user] problems with private constructor Date: Sun, 12 Sep 2004 19:28:53 -0500
If you only want to Marshal, and don't want to unmarshal then you can use the following:
<class name="Person" verify-constructable="false"> .. </class>
As for your factory method, currently factory methods are only supported on the parent class. There is no real technical reason for this limitation, Castor should support factory methods that are on the actual object as well as stand-alone factories, just need someone who has the time to implement them.
--Keith
Rafa Jurado Rivas wrote:
>
> Hello everybody and thanks for help me.
>
> I have a problem when I try to marshal a class like this:
>
> public class Person {
>
> .... Attributes ....
>
> .... private Constructor ....
> private Person() {
> super();
> }
>
> ..... Factory for the class .....
> public static Person createPerson() {
> return new Person();
> }
>
> ..... Other methods .....
> }
>
> I use a mapping file for marshalling. The class compiles perfecty, but when
> I try to marshal an object, it appears this:
>
> Exception en thread "main" org.exolab.castor.mapping.MappingException: The
> Java class Person is not constructable -- it does not contain a default
> public constructor ..........
>
> My question is: How can I specify this class has a factory method? Is it
> posible to avoid the need of a public default constructor?
>
> _________________________________________________________________
> Un amor, una aventura, compa��a para un viaje. Reg�strate gratis en MSN Amor
> & Amistad. http://match.msn.es/
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-user
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
_________________________________________________________________
Hor�scopo, tarot, numerolog�a... Escucha lo que te dicen los astros. http://astrocentro.msn.es/
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
