Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Adding custom validation(Adding custom validation to EMF Generated Live Validator)
Adding custom validation [message #1095636] Tue, 27 August 2013 10:20 Go to next message
John Mark is currently offline John MarkFriend
Messages: 13
Registered: November 2012
Junior Member
Hi,
I have used this tutorial and implemented Live Validation(amazing feature BTW) -

http://ed-merks.blogspot.de/2013/01/decorating-with-emf.html

Now I want to know How to extend it to add my own validations?

Thanks,
Mark
Re: Adding custom validation [message #1095642 is a reply to message #1095636] Tue, 27 August 2013 10:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Mark,

You can declare constraint in the model via annotations and when such
annotations are present, a validator will be generated:

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/references/overview/EMF.Validation.html

I'd suggest having a look at EcoreValidator. If you want better
messages, you'll want to define a plugin class for your model in the
*.genmodel so you can add to the plugin.properties and use them in your
validator.


On 27/08/2013 12:20 PM, John Mark wrote:
> Hi,
> I have used this tutorial and implemented Live Validation(amazing
> feature BTW) -
>
> http://ed-merks.blogspot.de/2013/01/decorating-with-emf.html
>
> Now I want to know How to extend it to add my own validations?
>
> Thanks,
> Mark


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Adding custom validation [message #1095688 is a reply to message #1095642] Tue, 27 August 2013 11:47 Go to previous message
John Mark is currently offline John MarkFriend
Messages: 13
Registered: November 2012
Junior Member
Thanks ED. I got this working.
Previous Topic:[Xcore] multi-level class hierarchy extension
Next Topic:How can I create a Map with Xcore?
Goto Forum:
  


Current Time: Mon Dec 09 04:21:43 GMT 2024

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

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

Back to the top