Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Multiple Validation Classes -- Dynamic
Multiple Validation Classes -- Dynamic [message #1002422] Fri, 18 January 2013 09:47 Go to next message
Eclipse UserFriend
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 07:42 Go to previous messageGo to next message
Eclipse UserFriend
Nobody ?
Re: Multiple Validation Classes -- Dynamic [message #1024035 is a reply to message #1002422] Mon, 25 March 2013 13:34 Go to previous messageGo to next message
Eclipse UserFriend
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 11:56 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 10:54:24 EDT 2025

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

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

Back to the top