Hi Barbara,
without a closer look at your enhancement request, 2 questions came to
my mind:
1. How would you specify that Castor should create a getter with a
PropertyChangeListener for sharedItem but one without for notSharedItem?
2. Where should Castor get the PropertyChangeListener from when
unmarshalling?
Having said that this seams to be a very special enhancement that may
not be of help to much other people in my opinon. If other committers
share this opinon we would refuse that enhancement. Another point, if we
agree to add this feature, is, if you would be in a position to provide
us with a patch to add this.
Regards
Ralf
Castor JDO, committer
Barbara Prechtl schrieb:
To whom it may concern:
I have been working with Castor for generation of code from a schema.
This has been working very well. I really appreciate all the work that
has gone into this project. My question is related to the code that gets
generated.
In the environment I am working in, I need to enforce that certain
objects are registered for. It is nice that Castor has the ability to
generate the property change listeners for an object. I was just
wondering if there is a way to ensure that the item getter has the
property change listener in the getter method signature.
For instance:
<xsd:complexType name="DataObject">
<xsd:sequence>
<xsd:element name="sharedItem"
type="xsd:string"></xsd:element>
<xsd:element name="notSharedItem"
type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
For the above schema type, I would like to be able to specify to castor
to generate the class so that the getter for the "sharedItem" property
has a listener required and the getter or the "notSharedItem" does not.
For instance the class would be generated as such:
public class DataObject {
String sharedItem = null;
String notSharedItem = null;
public String getSharedItem(PropertyChangeListener pc) {
sharedItem.addPropertyChangeListener(pc); // or what
ever is needed
return sharedItem();
}
public String getNotSharedItem() {
return notSharedItem;
}
}
We are using this data as the model for a gui interface. There are
multiple editors on the gui so some of the data is shared between
editors. We would like to enforce that when shared data items are
obtained they require that the listener is registered via the method
signature.
The option that we have come up with is to wrap each of the castor
classes with our own implementation classes that enforce our
requirements on shared data. This may be a big effort, as most of the
data is embedded into the schema model elements, and the schema may
change as the project evolves.
I was just wondering if castor has any support for this type of
generation. I reviewed the user documentation, but have not come across
an answer.
Thanks,
Barbara
-------------------------------------------------
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]
-------------------------------------------------