I've got another small enhancement for source generator to announce. Like the last one ( http://www.mail-archive.com/[EMAIL PROTECTED]/msg13666.html ), this one's in bugzilla as an enhancement pending review, but I figured I'd mention it here in case anyone needs the functionality. Bugzilla: http://bugzilla.exolab.org/show_bug.cgi?id=1331 .
The enhancement adds two features to Source Generator's handling of collections.
1) As you may be aware, there's a castorbuilder property that tells source generator to expose the actual collection objects that generated classes use internally. (That property is org.exolab.castor.builder.extraCollectionMethods.) My patch increases the usefulness of this feature by allowing you to use the collection objects as the primary accessors for the generated objects. So instead of
public {type}[] get{Collection}();
public List get{Collection}AsReference();
You can have
public {type}[] get{Collection}AsArray();
public List get{Collection}();
Setters are similarly altered.
Once the patch is in place, you can enable this by using three castorbuilder properties to control the suffixes for access-as-array, access-as-collection, and set-by-copy. See the bugzilla page for more info or feel free to ask if you have questions.
2) Readers who are unhealthily familiar with the actions of source generator will have objected to my "get{Collection}AsReference" signature above. This is because source generator as it stands would generate that method with a return type of ArrayList. The second feature of this enhancement is an option to have the generated code appear as above -- i.e., using the Java 2 collections interfaces instead of an explicit ArrayList. This behavior is switchable with a castorbuilder property and, of course, only applies if you use -types j2. Again, see the bugzilla page for details.
Rhett
-- Rhett Sutphin Research Assistant (Software) Coordinated Laboratory for Computational Genomics and the Center for Macular Degeneration University of Iowa - Iowa City - Iowa - 52246 mailto:[EMAIL PROTECTED]
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
