Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 216983 - [Validation] improve configurability of validation messages
Summary: [Validation] improve configurability of validation messages
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Marcelo Paternostro CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 204200
  Show dependency tree
 
Reported: 2008-01-29 16:27 EST by Will Horn CLA
Modified: 2008-02-05 21:23 EST (History)
5 users (show)

See Also:


Attachments
Proposed changes (85.68 KB, patch)
2008-01-30 11:12 EST, Ed Merks CLA
no flags Details | Diff
Updates that include generator changes. (171.18 KB, patch)
2008-01-31 15:41 EST, Ed Merks CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Will Horn CLA 2008-01-29 16:27:19 EST
Build ID: 3.3.1.1

This feature request is to enhance the ability for clients to configure/customize the validation messages generated by EObjectValidator.

One suggestion mentioned in this thread http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg27459.html
is to refactor the creation of the BasicDiagnostic into a protected helper method that can be overridden by the generated subclass.  Additionally, getEcoreResourceLocator.getString would be refactored into a protected getString method that could also be overridden for customization.
Comment 1 Ed Merks CLA 2008-01-30 11:12:35 EST
Created attachment 88298 [details]
Proposed changes

I wonder how best to change the templates...
Comment 2 Ed Merks CLA 2008-01-30 11:14:36 EST
Guys,

I'm wondering how best to change the template if at all.  Obviously for 1.4 generation the base class methods wouldn't be available.  I suppose we could generate them.  Or I could just generated a comment in the TODO section of the validator showing the new pattern and suggesting it be used...

What do you think?
Comment 3 Dave Steinberg CLA 2008-01-30 13:27:18 EST
My first thought is to generate using the new pattern only when targeting 5.0 or higher.  The new pattern is nicer but, especially since it's not available on the built-in EObject validation, I doubt its worth generating the extra methods each time.
Comment 4 Ed Merks CLA 2008-01-31 15:41:58 EST
Created attachment 88454 [details]
Updates that include generator changes.

This introduces a new GenModel.runtimeVersion field of type GenRuntimeVersion that includes literals for EMF22, EMF23, and EMF24.  The new validator pattern is generated only for version EMF24 or greater.
Comment 5 Ed Merks CLA 2008-02-01 13:14:15 EST
The changes are committed to CVS for 2.4
Comment 6 Nick Boldt CLA 2008-02-05 21:23:16 EST
Fix available in HEAD: 2.4.0.I200802052000.