Hi,
Thank you for the castor product.
I'm quite new to castor and my knowledge of castor is limited. I have been
wandering if the current castor provides a "more" automatic way of
generating the source code in the following situation:
(a)
- DTD schema are defined.
- Use SourceGenerator to generate classes and class descriptors
(b)
- Have my own classes that are inherited from the generated ones.
- When unmarshalling xml to objects, I would like to map the xml elements to
the classes of my own rather than generated ones.
The mechanism that I currently use is to create the description classes of
my own classes. These description classes are a copy of the generated ones,
except the class names that refer to the generated ones are replaced with my
own.
For example,
-the castor generator generates the Building and BuildingDescriptor
classes.
-BuildingNew class extends Building class.
-BuildingNewDescriptor is the same as BuildingDescriptor, except all the
references to Building class/object are now to BuildingNew class/object.
My question is that is there a way to tell the castor source code generator
such that, when unmarshalling, the X1 xml element is always mapped to X1New,
Y1 to Y1New, etc.
I believe the above mapping can be done using the mapping file, but my
impression is that using mapping file is slower than having the descriptor
classes. Is this so?
Alternatively, let the unmarshalling mechanism in castor allow the
application to alter the mapping at run time rather than at "generation"
time. This will require the current class descriptor classes be more
"generic".
My another question/request is that if the source generator can generated
interface classes to each of the XML elements/types, in addition to the
current implementation classes?
Thank you,
Wei
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev