Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Replacement for TypeReferences.isInstanceof()
Replacement for TypeReferences.isInstanceof() [message #1402093] Wed, 16 July 2014 10:01 Go to next message
Eclipse UserFriend
Hi,

After upgrading from Xtext 2.4 to 2.6 we noticed that the method
org.eclipse.xtext.common.types.util.TypeReferences.isInstanceOf(JvmTypeReference, Class<?>)
has been removed.

We used this method to validate the JvmType references of our model (whether they implement certain interfaces).

What is the recommended way to do this kind of validation with Xtext 2.6?
I checked LightweightTypeReference.isSubtypeOf() but I had the impression that the environments in which this method is used are rather connected with Xbase.
Our grammar is not based on Xbase.

Thank you in advance,
Csaba

Re: Replacement for TypeReferences.isInstanceof() [message #1402146 is a reply to message #1402093] Wed, 16 July 2014 11:33 Go to previous messageGo to next message
Eclipse UserFriend
did you try org.eclipse.xtext.common.types.util.TypeReferences.is(JvmTypeReference, Class<?>)
Re: Replacement for TypeReferences.isInstanceof() [message #1402550 is a reply to message #1402146] Thu, 17 July 2014 02:29 Go to previous message
Eclipse UserFriend
Hi Christian,

I did not try the "is" method, only looked at its implementation and from that it seems that it only checks qualified name equality. The implementation of the old "isInstanceOf" walked the superclass hierarchy and invoked "is" to find a match.

I also checked the commit that introduced the change to find out what is used now instead of the removed method (https://git.eclipse.org/r/#/c/21954/9), but could not find an Xbase-free usage.

Csaba
Previous Topic:No EObjectDescription could be found in Scope
Next Topic:Weird behavior using "Project/Clean.." in Eclipse
Goto Forum:
  


Current Time: Sun Jul 06 06:50:06 EDT 2025

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

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

Back to the top