Hi,

A general practice when using the Source Generator is NOT to use a
mapping file and let castor deals with the generator class descriptors
that contain all the necessary information to marshal and unmarshal your
xml/java with the corresponding validation.
Please be sure that you use the source generator WITHOUT using the
-nodesc option and that the generated descriptors are compiled.
For more information on the Source Generator, you can download the
documentation:
http://www.castor.org/SourceGeneratorUser.pdf

Arnaud

> -----Original Message-----
> From: The "Tone-ster" [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 22, 2002 10:48 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] xml -> java using Castor generated classes from
> Schema
> 
> 
> Hi folks,
> 
> New guy here.
> 
> I have been moving along smoothly for a bit and then I have hit a wall
> that is confusing the heck out of me.
> 
> I have at least the following (2) snippets from my Schema, which
> constitutes the piece of my mapping that I am having a problem with.
> 
> <!-- ******************** -->
> <!-- start chunk-o-schema -->
> <!-- ******************** -->
> <xs:complexType name="ContractHeaderType">
>       <xs:sequence>
>       .
>       .
>       .
>               <xs:element name="CancellationClauseInd"
type="YesNoType"
> minOccurs="0"/>
>       .
>       .
>       .
> </xs:complexType>
> 
> <!-- YesNoType Definition -->
> <xs:simpleType name="YesNoType">
>       <xs:restriction base="xs:string">
>               <xs:enumeration value="Y"/>
>               <xs:enumeration value="N"/>
>       </xs:restriction>
> </xs:simpleType>
> 
> <!-- ******************** -->
> <!-- end chunk-o-schema -->
> <!-- ******************** -->
> 
> I run the Castor code generator, and get a bunch of source out of it.
> 
> Included in the source is a subdirectory, <types>, that contains a
> "YesNoType.java" file.
> 
> Coincidentally, the ContractHeaderType.java has a "setter",
> setCancellationClauseInd that takes an instance of YesNoType.
> 
> This makes sense to me.
> 
> The problem I am having is figuring out the mapping.
> 
> If I map this as I have many of the other classes I am working with so
> far, I get a "not constructable" message.
> 
> In looking at the source, this makes sense as the generated source for
> YesNoType is an "enumeration" type of doo-hicky.
> 
> Again, ALL of this source was generated through the Castor source
> generator ... so why can't I get it all to "fit" back together again ?
> 
> Any help is greatly appreciated.
> 
> Mucho,
> Tony
> 
> PS. I saw one post that talked about a custom FieldHandler ? I didn't
> really understand what was being said in the post as it talked about
the
> persistence side ... where I am on the XML -> Object side ... and
> generally I was having a hard time understanding what was _actually_
> happening under the covers.
> 
> PSS. Are there any sources of "best practice" information for the XMl
> binding side ... the doc is a little slim.
> 
> --
> "Whenever you find yourself on the side of the majority,
>  it's time to pause and reflect."
> 
> -Mark Twain
> 
> --
> Fenestra mordeo nates !
> --
> http://www.x-plane.com
> 
> -----------------------------------------------------------
> 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