I have a class that extends EventObject, the mandatory constructor must take
an Object. Is there any way to provide a constructor argument in the class
tag of the mapping file. Here is the mapping and the class. I get the
following error when trying to marshal this class.

Nested error: org.exolab.castor.mapping.MappingException: The Java class
org.xoscript.server.event.ServerEvent is not constructable -- it does not
contain a default public constructor


public class ServerEvent extends EventObject{

    public String target = null;

    public ServerEvent (Object source, String targ){
        super(source);
        this.setTarget(targ);
    }

    getter and setters......
}

I want to ignore source in the output xml, that is way it is missing.
<class name="org.xoscript.server.event.ServerEvent">

    <field name="target" type="java.lang.String" direct="false">

        <bind-xml name="target" node="attribute"/>

    </field>

</class>

Bryan LaPlante



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

Reply via email to