Skip to main content



      Home
Home » Modeling » Papyrus » Sample Reflective Ecore Editor's Validator
Sample Reflective Ecore Editor's Validator [message #1364497] Sun, 18 May 2014 10:23 Go to next message
Eclipse UserFriend
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 10:24] by Moderator

Re: Sample Reflective Ecore Editor's Validator [message #1365175 is a reply to message #1364497] Sun, 18 May 2014 17:19 Go to previous messageGo to next message
Eclipse UserFriend
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 17:19] by Moderator

Re: Sample Reflective Ecore Editor's Validator [message #1366476 is a reply to message #1365175] Mon, 19 May 2014 06:27 Go to previous message
Eclipse UserFriend
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));
>
Previous Topic:Executable UML
Next Topic:Papyros model in Eclipse - Diagram's like magicdraw possible?
Goto Forum:
  


Current Time: Wed Jul 02 23:15:43 EDT 2025

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

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

Back to the top