Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Invoke validation programmatically
Invoke validation programmatically [message #643371] Mon, 06 December 2010 16:45 Go to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

Loading a model programmatically according to the FAQ validation is not performed.

Which is the suggested way to invoke validation programmatically?

Thank you,

Federico


Re: Invoke validation programmatically [message #643393 is a reply to message #643371] Mon, 06 December 2010 17:22 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 12/06/2010 05:45 PM, Federico Tomassetti wrote:
> Loading a model programmatically according to the FAQ validation is not
> performed.
>
> Which is the suggested way to invoke validation programmatically?
>
> Thank you,
>
> Federico

have you taken a look at the "testing validators" section in the manual?

hope this helps
cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: Invoke validation programmatically [message #643511 is a reply to message #643393] Tue, 07 December 2010 08:14 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Lorenzo,

why don't you simply use Diagnostician#validate?
However, with Xtext I'd recommend to use the IResourceValidator which
will provide a homogeneous view on the syntax errors, linking problems
and validation results (since 1.0).

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 06.12.10 18:22, schrieb Lorenzo Bettini:
> On 12/06/2010 05:45 PM, Federico Tomassetti wrote:
>> Loading a model programmatically according to the FAQ validation is not
>> performed.
>>
>> Which is the suggested way to invoke validation programmatically?
>>
>> Thank you,
>>
>> Federico
>
> have you taken a look at the "testing validators" section in the manual?
>
> hope this helps
> cheers
> Lorenzo
>
Re: Invoke validation programmatically [message #643515 is a reply to message #643511] Tue, 07 December 2010 08:36 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 12/07/2010 09:14 AM, Sebastian Zarnekow wrote:
> Hi Lorenzo,
>
> why don't you simply use Diagnostician#validate?
> However, with Xtext I'd recommend to use the IResourceValidator which
> will provide a homogeneous view on the syntax errors, linking problems
> and validation results (since 1.0).
>
> Regards,
> Sebastian

Thanks Sebastian

although I didn't post the original question your answer provides more
details than mine :)

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: Invoke validation programmatically [message #643516 is a reply to message #643511] Tue, 07 December 2010 08:44 Go to previous messageGo to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

With Diagnostician.validate I seem not to obtain what I want.

My DSL extends another DSL and using Diagnostician.validate the JavaValidator and the typesystem of the base language also when I would expect the one from the "sublanguage" is used.


Re: Invoke validation programmatically [message #643565 is a reply to message #643516] Tue, 07 December 2010 13:12 Go to previous message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

Ok, it seems that using IResourceValidator both the validators are called:
- the one of the base language first
- the one of the sublanguage after

So I had to modify the Validator of the base language a little bit but now it works,

thank you,

Federico


Previous Topic:[Xpand] Root element not found
Next Topic:Grammar Question and using unordered groups
Goto Forum:
  


Current Time: Sat Apr 27 01:40:36 GMT 2024

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

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

Back to the top