Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Getting rid of fully qualified type names in ocl expressions
Getting rid of fully qualified type names in ocl expressions [message #1006546] Thu, 31 January 2013 11:00 Go to next message
Felix Dorner is currently offline Felix Dorner
Messages: 206
Registered: March 2012
Senior Member
Hi,

In the OCL Example console (mature console) I need to use fully qualified type identifiers. Does OCL have some built-in mechanism to let me use unqualified type identifiers, e.g. Library instead of library::Library instead?

If there's no builtin mechanis, is it possible to hack the (again, mature) interpreter to find types magically, e.g. by inspecting registered EPackages?

Cheers,
Felix
Re: Getting rid of fully qualified type names in ocl expressions [message #1006561 is a reply to message #1006546] Thu, 31 January 2013 12:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4035
Registered: July 2009
Senior Member
Hi

The basic construction of an EcoreEnvironment takes a package registry.
You could poke as many packages as you like in to the registry.

Regards

Ed Willink


On 31/01/2013 16:00, Felix Dorner wrote:
> Hi,
>
> In the OCL Example console (mature console) I need to use fully
> qualified type identifiers. Does OCL have some built-in mechanism to
> let me use unqualified type identifiers, e.g. Library instead of
> library::Library instead?
>
> If there's no builtin mechanis, is it possible to hack the (again,
> mature) interpreter to find types magically, e.g. by inspecting
> registered EPackages?
>
> Cheers,
> Felix
>
Re: Getting rid of fully qualified type names in ocl expressions [message #1007098 is a reply to message #1006546] Mon, 04 February 2013 07:59 Go to previous messageGo to next message
Felix Dorner is currently offline Felix Dorner
Messages: 206
Registered: March 2012
Senior Member
Hi Ed,

qualified classifier names are not the problem. I want to dynamically resolve _unqualified_ classifier names against registered package. I could then just write "Author.allInstances()" instead of "library::Author.allInstances()". I think I could try to customize EcoreEnvironment.lookupClassifier() to implement such a dynamic cross-package lookup.

Felix
Re: Getting rid of fully qualified type names in ocl expressions [message #1007722 is a reply to message #1007098] Thu, 07 February 2013 05:07 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4035
Registered: July 2009
Senior Member
Hi

I think you may find lookupPackage easier. There is already a lookup for
no explicit package so you just need to broaden it.

Regards

Ed Willink


On 04/02/2013 12:59, Felix Dorner wrote:
> Hi Ed,
>
> qualified classifier names are not the problem. I want to dynamically
> resolve _unqualified_ classifier names against registered package. I
> could then just write "Author.allInstances()" instead of
> "library::Author.allInstances()". I think I could try to customize
> EcoreEnvironment.lookupClassifier() to implement such a dynamic
> cross-package lookup.
>
> Felix
Previous Topic:[Announce] Eclipse OCL 4.1.0 (Kepler) M5 is now available
Next Topic:Property::CompatibleInitialiser' constraint is not satisfied
Goto Forum:
  


Current Time: Fri Aug 29 10:15:47 EDT 2014

Powered by FUDForum. Page generated in 0.05884 seconds