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
2
votes
2 answers

Eclipse Xtend and static methods

I find it odd that I couldn't find anyone asking about this before. But is it impossible to use static methods in XTend?? I'm using the play framework and the controller objects require your methods to be static. So does XTend really just not…
Zergleb
  • 2,212
  • 15
  • 24
2
votes
1 answer

How do I write static blocks in Xtend?

Just like in Java: static { } What should I do?
ChSF
  • 23
  • 2
2
votes
2 answers

Eclipse Plugin - How do I create all folders (IFolders) in a given path (IPath)

In my Generator.xtend class I'm trying to create a package from a given path, like given "com/example/config", I want to create the config folder in the example folder within the com folder. This is what I've tried so far: def static…
Mukendi
  • 43
  • 6
2
votes
1 answer

How to find out in Xtend if an optional feature from an Xtext grammar is used or not?

I have the following xtext fragments: LongDmxColor: intensity=DmxValue red=DmxValue green=DmxValue blue=DmxValue (white=DmxValue)?; and DmxValue returns INT: value=INT; In the generated LongDmxColor.java class, there are the following…
Michel Keijzers
  • 15,025
  • 28
  • 93
  • 119
2
votes
1 answer

How to fix error occuring while executing EValidator

i want to create a parser of obj files with xtext. I already wrote a part of the grammar, now i was writing the validator, but while testing my grammar and validator an error occured. Can anyone helps me? Here is my grammar code: grammar…
Brandon
  • 33
  • 6
2
votes
1 answer

How to add custom import statements in the generated java file in xtext using jvmmodelInferrer?

I have written a grammar for my domain specific language in xtext and I am using jvmmodelInferrer to generate java code. I can generate fields and custom methods but how can I add custom import statements like 'import java.util.*' in the generated…
2
votes
1 answer

Xtext how to reference variables by qualified name through an instance?

I am having trouble with this concept in building a dsl. I am not sure if it is a simple thing I am missing or something that is not an intended feature of xtext. Hopefully someone can explain it to me in the context of this example. Given the…
Zannith
  • 429
  • 4
  • 21
2
votes
1 answer

Running an exported Xtend based application

I am attempting to use Xtend to generate and run an exported Eclipse RCP application. I am using Windows 10 with Java 1.8.0_181 and Eclipse Photon. The following steps will recreate the problem in as clean an environment as I can create: Install…
Jonathan
  • 2,635
  • 3
  • 30
  • 49
2
votes
1 answer

Pass method as argument to Java method

I have some java code that I want to convert to Xtend. The Java code is: public void createPartControl(Composite parent) { final Canvas clock = new Canvas(parent, SWT.None); clock.addPaintListener(this::drawClock); } private void…
Jonathan
  • 2,635
  • 3
  • 30
  • 49
2
votes
0 answers

How to expand field initializers in xtend annotation processor

I am using Active Annotations to generate fields in my classes and am having difficulty discovering how to expand field initializer expressions. Without initializers the code looks like this class JavaFxPropertyProcessor implements…
systemcpro
  • 856
  • 1
  • 7
  • 15
2
votes
1 answer

Xtend: evaluate expression directly from a string

Is there a possibilty in the Xtend language to evaluate an expression directly from a string, e.g. like Eval in Groovy. I want to do something like this in Xtend (the example is from Groovy): import groovy.util.Eval assert Eval.me('2*5') == 10 If…
Software Craftsman
  • 2,999
  • 2
  • 31
  • 47
2
votes
0 answers

Validate xtext editor content which is generated by Grammar file

This I know Suppose we have to validate we have to write @check method inside ".xtend" get data from model then we can validate. But content which we printed from grammar how can we validate that consider following grammar IniDCommand: …
shreeram banne
  • 526
  • 4
  • 12
2
votes
1 answer

Xtext 2.10 (AbstractFormatter2): Indentation for single or multiline comments is not always correct

Problem Description: The default indentation for single or multiline comments does not always work properly. The following issues are being faced. The indentation for single line comments never worked if there wasn’t already at-least a space or a…
2
votes
2 answers

xtext parameterized xtext runner

Purpose: Run parameterized tests within xtext/xtend context. Progress: So far I have achieved getting it to run, but it is appearing wrong in the junit window. Issues: The failure trace and results of both tests appear in the last test, as shown in…
Casper Thule Hansen
  • 1,510
  • 2
  • 19
  • 36
2
votes
2 answers

Type mismatch: cannot convert from Class to Class xtest error

I am using this Xtest code to create a demo homeAutomation language github source but when the automatic code is generated i am getting errors in file AbstractHomeAutomationRuntimeModule like "type mismatch: cannot convert from Class to Class" i'm…
SHINTO JOSEPH
  • 377
  • 4
  • 17