Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [SOLVED] @ComposedChecks in MyDslValidator.xtend - class
[SOLVED] @ComposedChecks in MyDslValidator.xtend - class [message #1371197] Wed, 21 May 2014 09:02 Go to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

is it possible to use the @ComposedChecks-Tag to register some customvalidators in the
default MyDslValidator.xtend - class?

I have some problems doing this, cause an error appears in the MyDslValidator.xtend class:

error: The value for an annotation attribute must be a constant expression


~Alex

[Updated on: Wed, 21 May 2014 09:12]

Report message to a moderator

Re: @ComposedChecks in MyDslValidator.xtend - class [message #1371209 is a reply to message #1371197] Wed, 21 May 2014 09:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi which xtend Version do you use

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: @ComposedChecks in MyDslValidator.xtend - class [message #1371218 is a reply to message #1371197] Wed, 21 May 2014 09:12 Go to previous messageGo to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
I found the problem!

It is not allowed to use these brackets : {} in the @ComposedChecks in a .xtend class

Solution for the use in a .xtend class:
//without {  } -brackets
@ComposedChecks(validators = CustomValidator )


~Alex
Re: @ComposedChecks in MyDslValidator.xtend - class [message #1371219 is a reply to message #1371218] Wed, 21 May 2014 09:14 Go to previous messageGo to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

I'm using Xtend 2.5.4v201404100756

Re: @ComposedChecks in MyDslValidator.xtend - class [message #1371245 is a reply to message #1371219] Wed, 21 May 2014 09:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
or for more than 2

@ComposedChecks(validators=#[V1,V2])


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: @ComposedChecks in MyDslValidator.xtend - class [message #1371331 is a reply to message #1371245] Wed, 21 May 2014 10:18 Go to previous message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Thanks!

This is not part of the new Xtext 2.5 documentation, isn't it?
Previous Topic:[SOLVED]Problem with Xtend keywords
Next Topic:Xtext 2.6 Available
Goto Forum:
  


Current Time: Wed Apr 24 20:53:36 GMT 2024

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

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

Back to the top