Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Validation error(...) Method Question(How to get EStructuralFeature for the error(...) validation method? )
Validation error(...) Method Question [message #831969] Thu, 29 March 2012 15:30 Go to next message
Wladimir Schamai is currently offline Wladimir SchamaiFriend
Messages: 53
Registered: May 2010
Member
Hi all,

I am struggling with the new error(...) validation method in Xtext 2.x. The documentation says:

Quote:
The methods error(..) and warning(..) in the AbstractDeclarativeValidator used to accept integer constants representing the EStructuralFeature which caused the issues. These integer parameters were replaced by the feature itself, e.g. from error(String, Integer) to error(String, EStructuralFeature). Use the generated EPackage to access the EStructuralFeature


Can anyone tell me how to get EStructuralFeature for a rule? What EPackage is mentioned here?

Thanks in advance
Wladimir
Re: Validation error(...) Method Question [message #831980 is a reply to message #831969] Thu, 29 March 2012 15:42 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 03/29/2012 05:30 PM, Wladimir Schamai wrote:
> Hi all,
>
> I am struggling with the new error(...) validation method in Xtext 2.x.
> The documentation says:
>
> Quote:
>> The methods error(..) and warning(..) in the
>> AbstractDeclarativeValidator used to accept integer constants
>> representing the EStructuralFeature which caused the issues. These
>> integer parameters were replaced by the feature itself, e.g. from
>> error(String, Integer) to error(String, EStructuralFeature). Use the
>> generated EPackage to access the EStructuralFeature
>
>
> Can anyone tell me how to get EStructuralFeature for a rule? What
> EPackage is mentioned here?
> Thanks in advance
> Wladimir

you should use your DSL (generated) EPackage

for instance MyDslPackage, in particular

MyDslPackage.Literals

where you get all the structural features...

as far as I know, both error and warning should deal seamlessly with
null EStructuralFeature in case

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


Previous Topic:How to insert javadoc into the generated EMF interfaces for mydsl
Next Topic:Unhandled event loop exception
Goto Forum:
  


Current Time: Wed Apr 24 19:00:53 GMT 2024

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

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

Back to the top