"TERRILL,JODY (HP-Boise,ex1)" wrote:
> 
> Next questions... :)
> 
> Is there any way (short of using XSL translation) to unmarshal an object
> based upon an Attribute?
> Example:
> <Command Type="Submit"/>
> would create a submit object while
> <Command Type="Query"/>
> would create a query object.

Not really...there is a trick....but it's a bit of work.

You need to use the "xsd:string" type for your attribute defintion.

Then you can modify the generated descriptor so that it can create the
Object from your the string value.

An example of this is DateFieldHandler, which takes a String and creates
a Date.

The Marshalling framework thinks it is simply dealing with a String, but
your object model actually uses something more complex.

The good thing, is that it can be done.

The bad thing is that you need to write the proper code. If you do this,
becareful
not to overwrite your code if you ever need to regenerate the object
model.

--Keith

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

Reply via email to