Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Validator
Validator [message #424163] Fri, 17 October 2008 18:45 Go to next message
Eclipse UserFriend
Originally posted by: nuclearpsyche.gmail.com

Hello,

I have custom validators that check if the provided value is between the
allowed lower and upper bounds. However the upper and lower bounds are
dynamic and depend on the model. So I need to read the model in the
validation function.
How can I access the model (the root object) from my validator?
Thanks,

tamer
Re: Validator [message #424164 is a reply to message #424163] Fri, 17 October 2008 18:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Tamer,

EcoreUtil.getRootContainer?


Tamer wrote:
> Hello,
>
> I have custom validators that check if the provided value is between
> the allowed lower and upper bounds. However the upper and lower bounds
> are dynamic and depend on the model. So I need to read the model in
> the validation function.
> How can I access the model (the root object) from my validator?
> Thanks,
>
> tamer


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Validator [message #424166 is a reply to message #424164] Fri, 17 October 2008 19:28 Go to previous message
Eclipse UserFriend
Originally posted by: nuclearpsyche.gmail.com

Ed,
Thanks, that's a very handy function!

t

Ed Merks wrote:
> Tamer,
>
> EcoreUtil.getRootContainer?
>
>
> Tamer wrote:
>> Hello,
>>
>> I have custom validators that check if the provided value is between
>> the allowed lower and upper bounds. However the upper and lower bounds
>> are dynamic and depend on the model. So I need to read the model in
>> the validation function.
>> How can I access the model (the root object) from my validator?
>> Thanks,
>>
>> tamer
Previous Topic:More tolerant handling of bad feature values
Next Topic:[VALIDATION] How to customize Messages when loading OCL from file
Goto Forum:
  


Current Time: Thu Apr 25 13:53:09 GMT 2024

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

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

Back to the top