Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XTend] something like instanceof?
[XTend] something like instanceof? [message #537411] Wed, 02 June 2010 11:49 Go to next message
jeremie is currently offline jeremie
Messages: 233
Registered: April 2010
Senior Member
Hi,

Is there in XTend something like the "instanceof" oj Java?

Jérémie
Re: [XTend] something like instanceof? [message #537415 is a reply to message #537411] Wed, 02 June 2010 12:04 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten Thoms
Messages: 354
Registered: July 2009
Location: Dortmund
Senior Member

Hi Jeremie!

Yes, types have an isInstance() operation.

MyType.isInstance(someObject)

Regards,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [XTend] something like instanceof? [message #537416 is a reply to message #537411] Wed, 02 June 2010 12:04 Go to previous messageGo to next message
Darius Jockel is currently offline Darius Jockel
Messages: 63
Registered: July 2009
Member
Hello,

every MetaType has a static method isInstance.
E.g.: Entity.isInstance(e)

See: Xpand Documentation > Built-in types API documentation
xpand2::Type

Regards
Darius

[Updated on: Wed, 02 June 2010 12:05]

Report message to a moderator

Re: [XTend] something like instanceof? [message #537629 is a reply to message #537416] Thu, 03 June 2010 06:46 Go to previous message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1769
Registered: July 2009
Senior Member
Note, that those methods are not static. MetaType is a typeliteral
similar to MetaType.class in Java.

Sven

Darius Jockel schrieb:
> Hello,
>
> every MetaType has a static method isInstance. E.g.: Entity.isInstance(e)
>
> Regards
> Darius


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:[Xtend] test on infinity value
Next Topic:[Xtend] access to Issues from JAVA extension
Goto Forum:
  


Current Time: Thu Oct 23 15:22:04 GMT 2014

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

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