Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » XML schema "fixed" attribute and static final fields
XML schema "fixed" attribute and static final fields [message #603421] Tue, 11 November 2008 14:01
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
I am having some issues with EMF 2.4 generating static final fields that
correspond to the "fixed" attribute in the schema definition. For example,
using this snippet my from XML Schema definition:

<xs:attribute name="classCode" type="RoleClass" use="optional"
default="BIRTHPL"/>

Under EMF 2.2, this is what gets generated:

protected static final Object CLASS_CODE_DEFAULT =
CDAR2Factory.eINSTANCE.createFromString(CDAR2Package.getRole Class(),
"BIRTHPL");
protected Object classCode = CLASS_CODE_DEFAULT;

Under EMF 2.4, this is what gets generated:

protected static final Object CLASS_CODE_DEFAULT; // TODO: the default
literal value "BIRTHPL" is not valid.
protected Object classCode = CLASS_CODE_DEFAULT;

which obviously fails compilation due to unassigned static final field.

What has changed between the two EMF versions that would cause this issue?
Is there a workaround?

Thanks,

JT
Previous Topic:xsd.ecore is not based on ecore.ecore
Next Topic:Dealing with a set of large XML schemas
Goto Forum:
  


Current Time: Mon Sep 01 17:05:44 EDT 2014

Powered by FUDForum. Page generated in 0.01458 seconds