Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [XTend] something like instanceof?
[XTend] something like instanceof? [message #537411] Wed, 02 June 2010 07:49 Go to next message
Eclipse UserFriend
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 08:04 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jeremie!

Yes, types have an isInstance() operation.

MyType.isInstance(someObject)

Regards,
~Karsten
Re: [XTend] something like instanceof? [message #537416 is a reply to message #537411] Wed, 02 June 2010 08:04 Go to previous messageGo to next message
Eclipse UserFriend
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 08:05] by Moderator

Re: [XTend] something like instanceof? [message #537629 is a reply to message #537416] Thu, 03 June 2010 02:46 Go to previous message
Eclipse UserFriend
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
Previous Topic:[Xtend] test on infinity value
Next Topic:[Xtend] access to Issues from JAVA extension
Goto Forum:
  


Current Time: Wed Jul 23 15:06:07 EDT 2025

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

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

Back to the top