Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » IAssignabilityComputer (How to replace it ?)
IAssignabilityComputer [message #1059733] Tue, 21 May 2013 08:52 Go to next message
Kevin SERIN is currently offline Kevin SERIN
Messages: 12
Registered: May 2013
Junior Member
Hello,

I have a code where there are these lines:
import org.eclipse.xtext.common.types.util.IAssignabilityComputer;

[...]

public class MyValidator extends AbstractMyValidator {

@Inject
IAssignabilityComputer typeComp;

[...]


The 'typeComp' attribute is to use the mthod 'isAssignableFrom'.
I suppose that now we should use isAssignable from the interface Type.
The problem is I use a JvmParameterizedTypeReference which is not a Type.

So is there an easy way to replace the IAssignabilityComputer ?
Re: IAssignabilityComputer [message #1059908 is a reply to message #1059733] Wed, 22 May 2013 03:17 Go to previous messageGo to next message
Kevin SERIN is currently offline Kevin SERIN
Messages: 12
Registered: May 2013
Junior Member
Do you think that this is code:

@Inject
TypeReferences typeRef;
[...]
JvmParameterizedTypeReference typeReference = ... ;
JvmParameterizedTypeReference typeReference2 = ... ;
if(typeRef.isInstanceOf(typeReference, Class.forName(typeReference2.getType().getIdentifier()))) { [...] }


do the smae thing as:
@Inject
IAssignabilityComputer typeComp;
[...]
JvmParameterizedTypeReference typeReference = ... ;
JvmParameterizedTypeReference typeReference2 = ... ;
if(typeComp.isAssignableFrom(typeReference, typeReference2)) { [...] }

?
Re: IAssignabilityComputer [message #1059911 is a reply to message #1059908] Wed, 22 May 2013 03:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4444
Registered: July 2009
Senior Member
http://www.eclipse.org/forums/index.php/m/1041571/?srch=TypeConformanceComputer#msg_1041571
Re: IAssignabilityComputer [message #1059922 is a reply to message #1059911] Wed, 22 May 2013 04:01 Go to previous message
Kevin SERIN is currently offline Kevin SERIN
Messages: 12
Registered: May 2013
Junior Member
thanks
Previous Topic:add a field Automatically
Next Topic:reload all elements from the XMFResource
Goto Forum:
  


Current Time: Tue May 28 17:17:59 EDT 2013

Powered by FUDForum. Page generated in 0.01603 seconds