[xsd-users] Custom get/set methods

Boris Kolpackov boris at codesynthesis.com
Thu Nov 15 12:48:04 EST 2007


Hi Vinay,

Mogulothu, Vinay K <vinay.mogulothu at lehman.com> writes:

>   Thank you. We have looked at the option of customizing the generated
> types, but as you mentioned it requires scripts to add the custom
> wrappers for this option. We are interested in generating custom
> class/function names. Please let us know if this feature is an easy
> addition.

It shouldn't be too difficult to add. The only concerns we have at the
moment are: (1) whether the regex approach will be able to handle all
desired transformations and (2) how to pass this information to the
compiler.

For (1), we need to make sure that we can support common naming
conventions, e.g., "lower case and underscore", "camel case",
"smalltalk", etc. Your case should be fairly easy to handle
since all you need to do is to add the 'get' or 'set' prefix
and capitalize the first letter of the original name.

For (2) we normally use command line options but depending on
how many expressions one may want to provide (right now it is
at least three: getter function, setter function, and class),
this could get messy. So will need to think about alternative
methods.

If anybody has any ideas or suggestions (Ray?), they will be
much appreciated.

I will give it some more thoughts and will try to implement this
idea next week. I should have a pre-release for you to try by
the end of next week.

Boris




More information about the xsd-users mailing list