[TEXO] Enum valueshttps://www.eclipse.org/forums/index.php/mv/msg/351285/870678/#msg_870678
I have an enum defined in my XSD and want to automatically create the RuleType.java enum so that we get something closer to :

[size=2]public enum RuleType {
1,
2;
}[/size]

The XSD will contain many enumerations. I would prefer to set the default behaviour once for the whole model rather than adding an annotaion to each enum. Any ideas on how this can be implemented please?

I have now altered the XSD restrictions to be non-Integer String values. The Enum values match the restrictions as expected.

Sorry to waste your time.

Regards,
Gary]]>Gary Godfrey2012-05-09T12:23:52-00:00Re: [TEXO] Enum valueshttps://www.eclipse.org/forums/index.php/mv/msg/351285/871638/#msg_871638
I now been supplied with a valid XSD enum which needs to be mapped to a Java enum:

Regards,
Gary]]>Gary Godfrey2012-06-07T14:17:58-00:00Re: [TEXO] Enum valueshttps://www.eclipse.org/forums/index.php/mv/msg/351285/882983/#msg_882983
Hmm, I don't have a good solution right away... I think the best you can do is write a short java program which reads
the ecore and sets all names to be the same as the literal and then saves the ecore.

But why do the generated code and the xsd need to match? Afaik the xml which gets generated from the code should be
correct and follow the xsd, right?