Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Sample Reflective Ecore Editor's Validator
Sample Reflective Ecore Editor's Validator [message #1364497] Sun, 18 May 2014 14:23 Go to next message
John Smith is currently offline John SmithFriend
Messages: 12
Registered: March 2014
Junior Member
Dear All,

How can I programmatically execute the Sample Reflective Ecore Editor's validator on a specified Ecore instance model?

I need to verify a model, before I transform it. So I need a method that returns whether the specified model is valid.

Thank you for help in advance!

Best regards,
John

[Updated on: Sun, 18 May 2014 14:24]

Report message to a moderator

Re: Sample Reflective Ecore Editor's Validator [message #1365175 is a reply to message #1364497] Sun, 18 May 2014 21:19 Go to previous messageGo to next message
John Smith is currently offline John SmithFriend
Messages: 12
Registered: March 2014
Junior Member
Here is the solution:

BasicDiagnostic diagnostics = new BasicDiagnostic();
Map<Object, Object> context = new HashMap<Object, Object>();
Diagnostician.INSTANCE.validate(EObject-to-be-validated,diagnostics,context));

[Updated on: Sun, 18 May 2014 21:19]

Report message to a moderator

Re: Sample Reflective Ecore Editor's Validator [message #1366476 is a reply to message #1365175] Mon, 19 May 2014 10:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31640
Registered: July 2009
Senior Member
John,

Even simpler is
org.eclipse.emf.ecore.util.Diagnostician.validate(EObject) which returns
a diagnostic.

On 18/05/2014 11:19 PM, John Smith wrote:
> Here is the solution:
>
> BasicDiagnostic diagnostics = new BasicDiagnostic();
> Map<Object, Object> context = new HashMap<Object, Object>();
> Diagnostician.INSTANCE.validate(<EObject_to_be_validated>,diagnostics,context));
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Executable UML
Next Topic:Papyros model in Eclipse - Diagram's like magicdraw possible?
Goto Forum:
  


Current Time: Sat Dec 05 01:07:06 GMT 2020

Powered by FUDForum. Page generated in 0.01598 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top