Issue Details (XML | Word | Printable)

Key: CASTOR-399
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Werner Guttmann
Reporter: XML 4 @ll
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
castor

Add configuration parameter for public members

Created: 19/Mar/03 11:02 AM   Updated: 20/Apr/07 10:23 AM
Component/s: XML code generator
Affects Version/s: 0.9.4.2
Fix Version/s: 1.1 M1

Time Tracking:
Not Specified

File Attachments: 1. Text File patch.c399.20061129.txt (34 kB)

Environment: Operating System: Windows 2000
Platform: All


 Description  « Hide
Although this request may seem counter to good OO practice, I'm to using XML
with a system that requires the members be public instead of private. I propose
adding a configuration parameter to castorbuilder.properties allow for public
members. A second item I would like to propose is to provide facilities for
altering the way propertychangelistener events are triggered in set methods. In
some cases, I want to check to see if a valid value is passed before I call
notify. this is important in cases where there are large number of classes
listening to the events. firing an event un-necessarily may not be desirable in
some cases, so providing alternate implementation would be desirable.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
XML 4 @ll added a comment - 20/Mar/03 11:32 AM
I would like to implement a patch for these feature enhancements. Before I go
ahead and do it, I'd like to know if the castor developers think the features
are desirable and the likelihood of it getting accepted. Assuming of course the
patch is good and doesn't have any bugs.

Keith Visco added a comment - 23/Apr/03 11:10 PM
Arnaud, what do you think...something that the binding file could support?

Arnaud Blandin added a comment - 24/Apr/03 01:47 AM
The binding file is definitely the place to go. We could have a feature to
select the visibility of a class member (private, public,protected)

Werner Guttmann added a comment - 02/Nov/06 12:37 PM
One could, for example, add a new attribute 'visibilty' to the complexType 'fieldType' in binding.xsd, similar to

<xsd:attribute name="visibility">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="public"/>
<xsd:enumeration value="protected"/>
<xsd:enumeration value="private"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>

to allow a user to specify the visibility of a field.


Werner Guttmann added a comment - 02/Nov/06 12:45 PM
Index: C:/workspace/castor1675/src/main/resources/org/exolab/castor/builder/binding/binding.xsd
===================================================================
— C:/workspace/castor1675/src/main/resources/org/exolab/castor/builder/binding/binding.xsd (revision 6380)
+++ C:/workspace/castor1675/src/main/resources/org/exolab/castor/builder/binding/binding.xsd (working copy)
@@ -188,6 +188,15 @@
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
+ <xsd:attribute name="visibility">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="public"/>
+ <xsd:enumeration value="protected"/>
+ <xsd:enumeration value="private"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
<xsd:attribute name="validator" type="xsd:string"/>
</xsd:complexType>

Werner Guttmann added a comment - 29/Nov/06 05:25 PM
Initial (untested) patch

Werner Guttmann added a comment - 30/Nov/06 07:41 AM
Patch committed (incl. new CTF test case). If you still would want to see the changes to the property change listener being implemented, please feel free to open a new (follow-up) issue.