Questions tagged [xtend]

Xtend is a statically typed programming language that transcompiles to Java. It aims to produce more readable code than traditional Java.

Xtend is a programming language that transcompiles to Java. It aims to produce more readable code than traditional Java by reducing the amount of boilerplate code. It is developed by the Eclipse foundation.

415 questions
0
votes
1 answer

Android ActivityMontior with XTend

I am trying to write an Android app using Xtend, however, I am more or less new in both. I have created a couple of Android examples with Java, but I'm still learning. In these apps i used the android.app.Instrumentation.ActivityMonitor in order to…
Causteau
  • 117
  • 1
  • 10
0
votes
1 answer

xext grammar with chosen predicates

I am trying to understand a xtext grammar I have found (below). I have two questions: The XFeatureCall has return Type XExpression but this is overruled by {XFeatureCall} so I could set "returns XFeatureCall" as well?. Or is it actually necessary…
moin moin
  • 2,263
  • 5
  • 32
  • 51
0
votes
1 answer

Xtend model data access from top level (Code generation)

If I have an Xtext grammar like the one below: grammar org.xtext.example.mydsl.ServerGeneratorLanguage with org.eclipse.xtext.common.Terminals generate serverGeneratorLanguage "http://www.xtext.org/example/mydsl/ServerGeneratorLanguage" Model: …
Charles Henry
  • 353
  • 3
  • 16
0
votes
1 answer

How can I connect to a MySQL database with Xtend.

I am trying to rewrite some java code to Xtend however I am running into an issue. I would like to connect to a mysql database. try { Class.forName("com.mysql.jdbc.Driver"); }catch(Exception e){ } The above snippet works in Java. However I am…
KennyBartMan
  • 940
  • 9
  • 21
0
votes
1 answer

Xtext Adding values to the grammar manually

I have a grammar that can parse a list of containers and modules, then generate these containers in alphabetical order. But, I also want to add the module names into the container list. For example: With the configuration: CONTAINER cont1; CONTAINER…
chris yo
  • 1,187
  • 4
  • 13
  • 30
0
votes
1 answer

Xtend for loop (desired while loop function)

I have some Xtend code that outputs data. Here is the code below: «FOR a:e.attributes» «a.eClass.name» «a.name», «ENDFOR» This would output something like: ClassName name1, ClassName name2, ClassName name3, ClassName name4, My Desired Output…
Charles Henry
  • 353
  • 3
  • 16
0
votes
1 answer

Xtend sorting using ECollections

I am trying to sort an EList of functions by using Java's Comparator, but the list is not sorted after calling sort(). The way I implement it is this: //Func.xtend <-- Start --> public class NameComparator implements Comparator { …
chris yo
  • 1,187
  • 4
  • 13
  • 30
0
votes
1 answer

Xtend/Xpand find and replace (rule)

Is it possible set a rule that will allow an Xpand method to output a specified string of text depending on the input. For example: «FOR a:e.attributes» Type = «a.eClass.name» Value = «a.name.toFirstUpper» «ENDFOR» The above code may…
Charles Henry
  • 353
  • 3
  • 16
0
votes
3 answers

Xtend Template Notation

i have a Problem with the Xtend Template Notation. I want to do «i=i+1» in a template method def generateSomething() ''' ... «i=i+1» ... ''' The «i=i+1» is obviously only to count i higher but it also shows the value of i in the generated file…
user1104033
0
votes
2 answers

Comparing Ecore Class and Types

I want to compare eCore-datatypes and eCore-classes in if-clauses. Something like this: if (ent == "Entity"){} "Entity" is the eCore-Class and "ent" an actual Object of this class. The same question goes for eCore Datatypes. if(ent.eType ==…
0
votes
1 answer

Transformation of security model written in own DSL-xtext

I've a security engineering model of business processes written in own DSL using xtext editor. For example, I've a security model for Activiti which has security controls e.g. securing transmission channel, encrypt message among processes, user…
nommyravian
  • 1,316
  • 2
  • 12
  • 30
0
votes
1 answer

Using JOptionPane with Xtend

I realize it might be a very stupid question, but how do I use JOptionPane with Xtend? I can't figure it out and I've been trying to get it working for a while now. JOptionPane.showMessageDialog(getContentPane(), message); doesn't seem to…
moskalak
  • 271
  • 2
  • 12
0
votes
1 answer

Avoid Custom Terminals Hiding (Suppressing) Derived Ones

I started playing around with xtext a few days ago and just went through the tutorials. Maybe the solution has been covered in the reference somewhere but I cannot get it right quickly. My problem is this. I tried to write a simple grammar which…
abel
  • 519
  • 1
  • 5
  • 15
0
votes
1 answer

Generating static objects in xtext

continue to the example of generating a field such as: def handle (EClass c) { val attr = EcoreFactory::eINSTANCE.createEAttribute attr.name = "test" attr.EType = EcorePackage::eINSTANCE.EString c.EStructuralFeatures += attr } can I…
Dana Klein
  • 159
  • 1
  • 12
0
votes
1 answer

code generate with xtend in xtext project

I'm working on xtext project and I'm generating objects through .xtext file. I want to add new attribute to one of the generated object. I saw in…
Dana Klein
  • 159
  • 1
  • 12
1 2 3
27
28