castor

Add configuration parameter for public members

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.9.4.2
  • Fix Version/s: 1.1 M1
  • Component/s: XML code generator
  • Labels:
    None
  • Environment:
    Operating System: Windows 2000
    Platform: All
  • Number of attachments :
    1

Description

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.

Activity

Hide
XML 4 @ll added a comment -

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.

Show
XML 4 @ll added a comment - 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.
Hide
Keith Visco added a comment -

Arnaud, what do you think...something that the binding file could support?

Show
Keith Visco added a comment - Arnaud, what do you think...something that the binding file could support?
Hide
Arnaud Blandin added a comment -

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)

Show
Arnaud Blandin added a comment - 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)
Hide
Werner Guttmann added a comment -

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.

Show
Werner Guttmann added a comment - 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.
Hide
Werner Guttmann added a comment -

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>

Show
Werner Guttmann added a comment - 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>
Hide
Werner Guttmann added a comment -

Initial (untested) patch

Show
Werner Guttmann added a comment - Initial (untested) patch
Hide
Werner Guttmann added a comment -

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.

Show
Werner Guttmann added a comment - 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: