Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Multiple Validation Classes -- Dynamic
Multiple Validation Classes -- Dynamic [message #1002422] Fri, 18 January 2013 14:47 Go to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 108
Registered: October 2010
Senior Member
In thread Using multiple providers there is an explanation how to use multiple Validator classes:
@ComposedChecks(validators={V1.class, V2.class})
public class MyDslJavaValidator extends AbstractMyDslJavaValidator {

}

This works fine if the validation classes are known at compile time. I now have a situation where additional validator classes are defined by new bundles that represent components of the DSL. Each component comes with its own validators. The validator classes are therefore not known at compile time.

Is there a way to easily add such validator classes at runtime to the main Xtext validator?

Regards, Jos
Re: Multiple Validation Classes -- Dynamic [message #1023887 is a reply to message #1002422] Mon, 25 March 2013 11:42 Go to previous messageGo to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 108
Registered: October 2010
Senior Member
Nobody ?
Re: Multiple Validation Classes -- Dynamic [message #1024035 is a reply to message #1002422] Mon, 25 March 2013 17:34 Go to previous messageGo to next message
Tim Geisler is currently offline Tim GeislerFriend
Messages: 37
Registered: July 2009
Member
Hi Jos,

we had the same problem. Our solution was to use the extension point org.eclipse.ui.startup to call a method on startup of the new bundle which then registers the new validator(s) with the EValidatorRegistrar.

Is there any better solution?

Best regards,

Tim
Re: Multiple Validation Classes -- Dynamic [message #1032132 is a reply to message #1023887] Tue, 02 April 2013 15:56 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 2936
Registered: July 2009
Senior Member
Am 25.03.13 12:42, schrieb Jos Warmer:
> Nobody ?

You may want to override
org.eclipse.xtext.validation.AbstractInjectableValidator.register(EValidatorRegistrar)
and read the additional validators from an extension point.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Previous Topic:How to read specific file from configuration?
Next Topic:Converting the MyDSL project to an non-PlugIn Project
Goto Forum:
  


Current Time: Mon Nov 24 03:57:58 GMT 2014

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

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