Your suggestion sounds like an excellent idea to me Patrick (I presume you read
my earlier posting regarding the problems I was encountering, but my suggested
solution wasn't as elegant).
Let me know if/when you plan to proceed. I may be able to assist to some degree
if you want (a day or two over the next couple of weeks). Unfortunately I've a 4
month old daughter and a hectic deadline to be met at the end of this month.
If you want to contact me directly can you please send to both of these
addresses:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Thanks,
Norval
Patrick Moore wrote:
> Hi there ---
>
> I am wondering if there is a way to use the <annotation><appinfo> notation
> with
> in a xml schema to tell castor when generating the java classes what the
> super
> class should be and what interfaces the generated class should implement. I
> also want to use a similiar construct for setting what the unmarshal method
> should indicate should be the class used when doing the unmarshaling.
>
> Example:
>
> <xsd:complexType name="LinkType">
> <xsd:annotation>
> <xsd:appinfo>
> <castor:superclass>
> com.sworddance.core.Link
> </castor:superclass>
> <castor:interface>
> com.sworddance.core.ILink
> </castor:interface>
> <castor:interface>
> com.sworddance.core.ILinkRW
> </castor:interface>
> <castor:unmarshal>
> com.sworddance.core.LinkConcrete
> </castor:unmarshal>
> </xsd:appinfo>
> </xsd:annotation>
> ....
> </xsd:complexType>
>
> This class would be generate:
>
> public class LinkType extends com.sworddance.core.Link
> implements com.sworddance.core.ILink,
> com.sworddance.core.ILinkRW {
>
> ....
> public static com.sworddance.core.LinkConcrete
> unmarshalLinkType(java.io.Reader reader)
> throws org.exolab.castor.xml.MarshalException,
> org.exolab.castor.xml.ValidationException
> {
> return (com.sworddance.core.LinkConcrete)
> Unmarshaller.unmarshal(com.sworddance.core.LinkConcrete.class, reader);
> }
>
> ....
> }
>
> It would be the responsiblity of the user to make sure that
> com.sworddance.core.LinkConcrete was correctly defined to be a subclass of
> LinkType
>
> Is there anyway to do this now? While a mapping file may solve the unmarshal
> problem it doesn't really address the desire to specify a superclass and
> interface.
>
> Also if anyone is working on a solution to this problem please let me know
> so
> that I don't waste my time writing my own solution.
>
> Thanks
>
> -Patrick Moore-
>
> -----------------------------------------------------------
> 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