Hello Clint,

I would also be insterested in such a feature but it seems to be pretty complex.

Indeed, the current version of axis uses the actual value of the enumeration if it is a valid java variable name. However, if it is not valid (like spaces in "this is my first value"), then the generic name "valueXX" is used.

To have meaningful names for such kind of values, we need to define the conversion of unsupported characters (more or less, everything except letters and numbers).

If we replace every non supported char by an underscore, we may face collisions.

For example "a value!" and "a value?" will return "a_value_". I admit the risk is very limited but it still exists.

Another way to do this may be to try to convert each restriction value and see if there are collisions. If yes, go back to "valueXX" ; if yes, use the converted value.

By the way, would it be intereting to us java constant naming convention (uppercase with underscore) for such variables as they are actual constants ?

Cyrille

PS : the method JavaEnumTypeWriter.getEnumValueIds() is in charge of getting names for these constants
--
Cyrille Le Clerc
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On 10/27/05, Dovholuk, Clint <[EMAIL PROTECTED] > wrote:
Hello all,

I was wondering if there were some switch on WSDL2Java I haven't come
across yet which allows it to generate java 5 enum's instead of the type
safe enum pattern.  Or alternatively, if there was another, different
switch which allowed the type safe enum pattern to create values one can
actually code with.  call me crazy, but _value1, _value2, _value3 isn't
the easiest to code with...  Sure I could use fromValue, but that's not
nearly as nice to code with, and it's not compile-time safe.

Are there any plans on getting this feature as an option on wsdl2java?

I looked all over the net and jira but I can't get quality hits back...

Thanks,
-Clint





Reply via email to