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

How to measure Xtend translation time for each input file

I'm building a DSL application in XTend and I need to measure the time it takes to translate each document that I run through it. I use the DSL capabilities to translate one data format (IFC) into another (TTL). I tried to measure it using…
Henry
  • 333
  • 1
  • 3
  • 10
3
votes
1 answer

convert xtend project to maven project

For project related work I am using Xtend programming.In my eclipse workspace, around 10 projects are there and all these projects are dependent on each other and some other plugins also I needed so I added those plugins to the target.Now I need to…
goodman
  • 424
  • 8
  • 24
3
votes
2 answers

Keyboard shortcut to insert « (guillemets ) in Xtend templates?

The documentation says Ctrl< but is seems not to work (I have Mmac with a US Keyboard). I can do CtrlSpace to insert a pair of quotes.
Michael_Scharf
  • 33,154
  • 22
  • 74
  • 95
3
votes
2 answers

Create an immutable map from a collection of pairs in Xtend

I have a collection of objects O from which I want to create an (immutable) map of two features (say, O.name and O.value). My best solution so far is newHashMap(o.map[it.name -> it.value]) But this will instantiate and initialize a new HashMap…
Stefan Winkler
  • 3,871
  • 1
  • 18
  • 35
3
votes
0 answers

How to debug xtend code in IntelliJ + Gradle?

I have just started to learn Xtend (http://xtend-lang.org/) and try to write a small app in IntelliJ 2016 based on a Gradle project using the Xtext/Xtend 2.10.0 plugins from the standard repository. The problem is that I cannot debug my Xtend code.…
user3625015
  • 101
  • 2
  • 5
3
votes
3 answers

Count value in template expression

I want to count a value inside a template expression, in Xtend, without printing it out. This is my code: def generateTower(Tower in) { var counter = 0.0; ''' One Two Three Four «FOR line : in.myTable» «counter» …
John
  • 795
  • 3
  • 15
  • 38
3
votes
1 answer

Xtext & Xtend - Adding more parameters to RequestMapping

I have been trying to generate Java spring code like the following. @RequestMapping(method=RequestMethod.DELETE, value="/message/{id}") public void reject(@PathVariable final Long id) { return; } I have provided the following code in the xtend…
Philip John
  • 5,275
  • 10
  • 43
  • 68
3
votes
1 answer

How to get full return type forwarding in Xtend's Active Annotations?

I'm trying out Xtend's Active Annotations by writing a simple "Logged" annotation for tracing when methods have been called. Basically I want to write this in Xtend: @Logged override onCreate() { sampleFuncCall() } and get something like this in…
Alex Jenter
  • 4,324
  • 4
  • 36
  • 61
3
votes
2 answers

XTend null safe throws NullPointerException

I am porting my template code to XTend. At some point I have this type of condition handling in a test case: @Test def xtendIfTest() { val obj = new FD if (true && obj?.property?.isNotNull) { return } fail("Not…
3
votes
1 answer

org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/../Less.xtext'

While trying to mavenize Eclipse plugin for LESS run into issue #210 In #208 added commit https://github.com/PaulVI/ow/commit/7c9db5373fcc09278e3314a7ceea616a3cd2d35a
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
3
votes
1 answer

maven: how to include annotation-generated .java files in the .jar

I have some java 7 annotation processors (for xtend) on my class-path. Via some annotations they create java files. This works great, in Elipse and in the Maven build. The generated files end up in target/generated-sources/annotations as…
TmTron
  • 17,012
  • 10
  • 94
  • 142
3
votes
1 answer

Xtend lambda expression overloading for Xtext QuickFix API

I am using Xtend to write custom QuickFixes for the Eclipse UI plugin of my Xtext language. The idea is to extend org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider and use call the accept method of an…
marinabilles
  • 78
  • 1
  • 6
3
votes
1 answer

sorting a hashmap by value in xtend

Suppose I have a java.util.HashMap object. I want to produce a List in which the entries in the HashMap are sorted high to low by the value of the Double. How do I do it? I've made a stab at it in Java using the Guava Ordering class, but I don't…
mathlawguy
  • 326
  • 1
  • 8
3
votes
2 answers

Debugging: working with generated Java code instead of Xtend code

When I debug Xtend code, I would sometimes like to see generated Java code with all the intermediate variables. However, even if I set a breakpoint inside this code, debugger shows Xtend code instead. Is it possible to switch to Java code in this…
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
3
votes
1 answer

Accessing class type

I'm trying to convert following java snippet to Xtend, but i couldn't able to do it. I'm not able to access static property 'class'. public class SyncService{ private static final String LOGT = SyncService.class.getSimpleName(); } I tried…
Palani
  • 8,962
  • 11
  • 53
  • 62
1 2
3
27 28