Bug 385867 - XMl and JSON annotations should only be allowed on Handlers and Records
Summary: XMl and JSON annotations should only be allowed on Handlers and Records
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: fahua jin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-24 11:09 EDT by Joseph Vincens CLA
Modified: 2017-02-23 14:05 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Vincens CLA 2012-07-24 11:09:28 EDT
This applies to the annotations where targets = [ ElementKind.fieldMbr ]

the XML annotations are in eglx.xml.binding.annotation
the JSON annotation is eglx.json.

Validation needs to be added to ensure the annotations are only allowed on Handlers and Records.
Comment 1 Paul Harmon CLA 2012-07-30 09:57:03 EDT
Rocky, here is a fairly easy validation task for you. First you will need to edit the EGL source for the annotation records to add a validation proxy class to the annotations. You can look at EGLProperty in eglx.lang.Annotatios.egl for an example of this.

Next you will need to recompile the system part eglar. Instructions can be found here: http://wiki.eclipse.org/EDT:How_to_update_system_parts

You can refer to the class EGLPropertyAnnotationTypeBinding.getAnnotations to see how to define the actual validator class

Basically, the validator will simply need to check if the target of the XML and JSON annotations are defined in a record or handler. If not, an error should be thrown.

To add the validation error, you will be updating org.eclipse.edt.compiler.core.ast.Node.IProblemRequestor to add the message constant and EGLValidationResources.properties with the actual message.
Comment 2 Matt Heitz CLA 2013-01-03 14:43:37 EST
Setting the target milestone to Future for bugs that won't be addressed in 0.8.2.