Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361687 - Support definition of XML element names on the model representing the element
Summary: Support definition of XML element names on the model representing the element
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2011-10-21 12:02 EDT by Rob Cernich CLA
Modified: 2021-11-19 09:22 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Cernich CLA 2011-10-21 12:02:16 EDT
Build Identifier: 

Please see forum post for additional details: http://www.eclipse.org/forums/index.php/t/245319/

Simply put, allow developers to define the XML element name on the model class representing the element.  This saves the developer from having to define a mapping in the containing class, moving that concern to the actual class managing the details of the element.  In other words, the contained elements provided their own names.

This becomes very useful when an element type may be extended (e.g. abstract XML types), especially when the specialized types are contributed dynamically (i.e. not known at the time the Sapphire model is created).

A side benefit is that it saves the developer from having to provide a mappings in the containing class.

Also refer to bug #360371 which allows developers to provide an alternate default naming.  It would be useful, in conjunction with this if the default name were generated using the name provided on the extended element, in the event no mapping is provided on the containing class.  Such a strategy would also provide backward compatibility for existing models. 

Reproducible: Always
Comment 1 Konstantin Komissarchik CLA 2011-11-22 19:43:41 EST
Feature implemented. You can now use @XmlBinding annotation at model element type level instead of specifying mappings. See further details in the enhancement guide. Unit test coverage provided by TestXmlBinding0011a - TestXmlBinding0011h.

Please verify.
Comment 2 Ling Hao CLA 2011-11-30 20:13:18 EST
Verified via unit tests, specifically TestXmlBinding0011b where TestModelElementB1 and TestModelElementB2 uses the @XmlBinding annotation.