Thank you very very much,
that was exactly what I've been looking for.
Andrew Fawcett schrieb:
Hi Mike,
Take a look at this option for the source generator, I think the "type" option is what you want.
http://www.castor.org/sourcegen.html#The-'type'-method
Andy.
________________________________
From: Mike Haller [mailto:[EMAIL PROTECTED]
Sent: Fri 01/07/2005 09:49
To: [email protected]
Subject: [castor-user] xsi:type, abstract types, method signatures
Hey all,
<xsd:element name="Info" minOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Foobar" maxOccurs="unbounded" minOccurs="0"
type="FoobarType"/>
</xsd:sequence>
<xsd:attribute name="Id" use="required" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
Castor XML Source Generated produces an Info.class with the following
Method:
public void addFoobar(Foobar vFoobar) {
...
}
This is not usable, since I cannot instantiate a "Foobar" object, since
"Foobar" is of type "FoobarType", which is an abstract type.
Why does Castor not generate a method with this signature:
public void addFoobar(FoobarType vFoobar) {
...
}
Then I could use whatever FoobarType-Implementation i'd like to.
I've read http://www.castor.org/xml-mapping.html#5.-xsi:type but I do
not use mapping files at all, since my model is generated by Castor XML
0.9.7 itself.
kind regards
Mike
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
------------------------------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------