Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » is ther anyway to autoimport classes (in external jar) while using Stringconcatenation
is ther anyway to autoimport classes (in external jar) while using Stringconcatenation [message #1777020] Thu, 23 November 2017 15:53 Go to next message
Ansem Bencheikh is currently offline Ansem BencheikhFriend
Messages: 3
Registered: October 2017
Junior Member
In the ModelInferrer , I need to build the body of my class using a loop method (evaluate outside of the construct .toclass).
I use a Stringconcatenation for that purpose :

val StringConcatenation vvv = new StringConcatenation
vvv.append('''«IScope» x = new IScope(null);''')

body ='''«vvv»'''
IScope is a class in an uploaded jar
If I mention the «IScope» class directly in the body it is correctly added in the generated java file with corresponding import,
but with the stringconcatenation it is displayed like this:
>>>class partrap.util.IScope
without the import statement
any help please,
Re: is ther anyway to autoimport classes (in external jar) while using Stringconcatenation [message #1777021 is a reply to message #1777020] Thu, 23 November 2017 15:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12037
Registered: July 2009
Senior Member
why

val StringConcatenation vvv = new StringConcatenation
vvv.append('''«IScope» x = new IScope(null);''')

if you want to do this use StringConcatenationClient.
and dont create StringConcatenation with new


=> either

body = '''«IScope» .....'''

or

body = '''«something»'''

with

def StringConcatenationClient something()
'''«IScope» ....'''


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: is ther anyway to autoimport classes (in external jar) while using Stringconcatenation [message #1777026 is a reply to message #1777021] Thu, 23 November 2017 16:24 Go to previous message
Ansem Bencheikh is currently offline Ansem BencheikhFriend
Messages: 3
Registered: October 2017
Junior Member
Thank for your quick reply,
it is clear,
Best Regards
Previous Topic:Traces are not generated
Next Topic:Created Projet Wizard Could not be started - ClassNotFoundException
Goto Forum:
  


Current Time: Thu Jun 21 12:29:51 GMT 2018

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

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

Back to the top