Greg,
I am doing something similar on my project. I have all my generated
classes extend from a pre-defined class. My binding definition is set
up similar to the following, using elementBinding instead of
complexTypeBinding, and it's working for me:
<elementBinding name="/ChildClass">
<java-class name="ChildClass">
<extends>com.xxx.SuperClass
</extends>
</java-class>
</elementBinding>
My generated classes end up defined like this:
public class ChildClass extends com.xxx.SuperClass implements
java.io.Serializable
public class ChildClassDescriptor extends
org.exolab.castor.xml.util.XMLClassDescriptorImpl
Hope this helps...
Cheers
Patty
-----Original Message-----
From: Greg Garson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 05, 2006 9:14 PM
To: [email protected]
Subject: [castor-user] XML - Question / Problems around 'extends'
element of the binding.xsd
Hello all,
Firstly, can someone clarify if the <extends> element has been
implemented as of Castor 1.0 M4? The Source Generation Documentation
seems to be a little ambiguous on this. Secondly, if this has been
implemented can someone explain its purpose? I assumed it was to be
used as a fine-grained method to allow me to have a single generated
class extend a handwritten class.
However with some testing it seems that the Source Generator assumes
that the class I provide was generated as part of the Source Generation
process.
An example of this is if I specific the following binding:
<binding xmlns="http://www.castor.org/SourceGenerator/Binding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.castor.org/SourceGenerator/Binding
./binding.xsd" defaultBindingType="type">
<complexTypeBinding name="AccountSearchFilter">
<java-class>
<extends>package.SearchFilter</extends>
</java-class>
</complexTypeBinding>
</binding>
Source Generator will create the following source files:
AccountSearchFilter.java
AccountSearchFilterDescriptor.java
As such AccountSearchFilter.java contains the following:
public class AccountSearchFilter extends package.SearchFilter
which is what I'm looking for, however
AccountSearchFilterDescriptor.java
contains:
public class AccountSearchFilterDescriptor extends
package.SearchFilterDescriptor
Given that SearchFilter is a hand coded class there is no
SearchFilterDescriptor file. Am I missing something here? Any pointers
or clues would be appreciated, also to note I have tried using the
org.exolab.castor.builder.superclass property, however this isn't fine
grained enough for my current needs.
Thanks in advance,
Greg
-------------------------------------------------
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]
-------------------------------------------------