Justin,
I don't think that is an option with the XML code generator right now,
and I am not sure whether it would be easy to add such functionality.
There's two options I'd have a look at, ....
a) see whether having the generated class extend one of your classes
eases your life (this can be achieved through e.g. a binding file).
b) Drop the generated classes (domain class and descriptor class), write
your own domain class (ValidateDouble in your case), and use a mapping
file for this class (only). All other classes will be generated and have
the binding information (namespaces, artifact names, ....) defined
through the generated descriptors.
I hope this helps.
Regards
Werner
Justin Lewis wrote:
> I am using castor codegenerator to generate java classes from a schema
> file. I have included part of my schema below.
>
> snippet from schema
>
> <element name="Foo" type="ValidatableDouble"/>
> <complexType name="ValidatableDouble">
> <simpleContent>
> <extension base="string"/>
> </simpleContent>
> </complexType>
>
> And instead of having a class generated called ValidatableDouble, I would
> like to be able to define my own ValidatableDouble class and somehow
> map/bind? my class instead of the generated one.
>
> Basically right now, I will end up with a class generated called
> "ValidatableDouble" and it will have one String member named "content". I
> would like to be able to define my own so I can add methods such as
> isValid(), doubleValue(), and getText(). I could define Foo as a String and
> handle validation outside of castor, but it would be more convenient to have
> it already done when the xml is marshalled/unmarshalled.
>
> Is there a way for me to do this ? I have been experimenting with mapping
> and binding, but I'm not sure I am able to accomplish this.
>
> Any help/direction is greatly appreciated.
>
> Thanks,
> Justin
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email