Mark,

let me try to provide you with an answer to your question. But let me
add that without a proper code review, this answer won't be precise as
it should be. But first of all, let's address one question first: the
context of your question is about mashalling or unmarshalling ? As a
default constructor is required for unmarshalling only.

Werner

Mark Hansen wrote:
> I'm trying to understand, in a relatively precise way, the
> [un]marshalling behavior of Castor for Java classes without class
> descriptors (i.r., based on reflection).  On the "Using Castor XML" page
> (http://www.castor.org/xml-framework.html), I see this:
> 
> " There is one main restrictions to marshalling objects. These classes
> must have have a public default constructor (ie. a constructor with no
> arguments) and adequete "getter" and "setter" methods to be properly be
> marshalled and unmarshalled."
> 
> Is there any more information about what "adequate getter and setter"
> methods means?
During unmarshalling, for any member of a Java class that is not a
collection, it's value will be set through a setter method. This is
achieved through calling the FieldHandler instance of the field in
question, which itself will issue the corresponding setX() method. The
signature of this method will be determined at startup, when e.g. the
mapping file is being analysed, etc.

> Are both a getter and a setter required?
For collections, things are a bit different, and I really cannot really
remember top of my head, but unless you specifically specify
set-method/get-method attributes in the mapping, strangely enough the
getter will be used to add a value to a collection member.
  Are strict
> JavaBeans naming conventions required?
> 
> Thanks,
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 

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

    http://xircles.codehaus.org/manage_email

Reply via email to