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

Reply via email to