David Blevins wrote:
An informal feature request for the devs and community at large.
The SourceGenerator can already create essentialy POJOs and has the smarts to create Descriptor classes that can marshal data to and from the schema and generated classes. I would really, really love it if it could use those smarts to create a mapping.xml file instead.
Note that I am NOT requesting a tool that can analyze and existing tree of objects and attempt to match them up with a schema or guess what the schema might look like--there already is a tool to do this.
What I am asking for is that the SourceGenerator have the ability to either create class descriptor java files with the schema-to-java marshalling data (as it does now) or create class elements a new mapping.xml file instead.
Has anyone else ever wanted this and/or have thought of implementing it?
David,
This is something that I have given some thought to in the past as well as more recently. However, generating a mapping descriptor from the SourceGenerator would only satisfy the needs of Castor XML (within the mapping descriptor that's created). While this would meet my needs for the Castor XML portions of the mapping descriptor, it still leaves me out in the cold as far as the Castor JDO portions.
What I have been doing recently is using XDoclet to generate the mapping descriptor. I've done this in the past for just the Castor JDO portions. but last month I expanded the capability of the XDoclet Castor functionality to support the entire Castor mapping descriptor. This satisfies both of the Castor XML and Castor JDO portions of the mapping descriptor. I start out by placing XDoclet taglets in the XSD. These taglets get carried through to the POJOs created by the SourceGenerator. From within Ant I call the SourceGenerator and then XDoclet using the <castormapping> element. This process then spits out a perfectly usable mapping descriptor.
If you want some additional detail on this process, see the Castor Live blog here:
http://jroller.org/page/CastorLive/20041015#round_trip_code_generation_with
I'm not sure if this will help you or not. Let me know what you're doing exactly and maybe we can find a solution for you.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\\"F9E<G)E=\\$\\!F<FEI+F-O;0\\`\\`");'
The Castor Project http://www.castor.org/
Apache Geronimo http://geronimo.apache.org/
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
