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

Cast wrapper class to primitive in Xtend

I have a for loop, in which I put Double values inside an array. Normally the values are from type double but as Xtend doesn't explicitly specify data types (and does this automatically) they are treaded as Doubles. I tried the following: for (i : 0…
John
  • 795
  • 3
  • 15
  • 38
0
votes
1 answer

Xtend compilation issues with static nested interfaces

I've been trying to solve this very strange bug for hours, and I simply can't figure it out. I have the following code in its own Xtend source file in a project in Eclipse: interface Apple { def void test() {} static interface Green extends…
Parker Hoyes
  • 2,118
  • 1
  • 23
  • 38
0
votes
0 answers

xtend @Externalized example: Error during annotation processing: java.lang.SecurityException: Prohibited package name: java.util.function

Has anyone else had this problem? I am using 2.9.1 on Mars. I used the Xtend Example Wizard to create "Xtend Active Annotations". The compiler test passes but the annotation @Externalized in the example client "MyMessages.xtend" is breaking with the…
0
votes
1 answer

Xtext and Xtend: Interfaces inside folder

I saw that the classes are generated inside separate folder/package. But the interface files are generated in the root folder instead of generating inside the specific package. Here is the code for JVM Inferrer: def dispatch void infer(Repository…
0
votes
1 answer

Xtend: Extending interface with interface

I am to new to Xtext. I need to extend an interface with interface. I need something like this: import org.springframework.data.jpa.repository.JpaRepository; @Repository public interface PHRRepository extends JpaRepository
0
votes
1 answer

Xtext and JVM: Adding Request Method to Request Mapping

I have a problem in Xtext. I need like this: @RequestMapping(value = "/create", method = RequestMethod.POST) public String updatePhr(@PathVariable(value = "id") Long id) But I am getting like this: @RequestMapping(value = "/create", method =…
0
votes
1 answer

How do I use external resources in xtext generated plugins?

I am new to Xtext and Xtend, and need advice how to best solve the issue below. I am trying to create a customized autocompletion provider using the following code: class DomainmodelProposalProvider extends AbstractDomainmodelProposalProvider { …
gwang
  • 153
  • 1
  • 7
0
votes
1 answer

Is there any possibility to declare global variable in Xtend2?

I'm working in code generator project with the use of Xtend2. I want to use global variable. Right now I'm using map for that purpose. Is there any possibilities to declare global variable instead of map?
0
votes
1 answer

Commit values in SyntaxErrorMessageProvider and use them in QuickfixProvider?

I am overriding the standard error messages used by Xtext. In my SyntaxErrorMessageProvider I am checking feature types. If the user typed in an double there should be a possibility to change it to integer by simply cutting the decimal…
John
  • 795
  • 3
  • 15
  • 38
0
votes
1 answer

Calling Xtext generator from an Eclipse View

I'm planning to generate code by calling the generator from a button located in an Eclipse View, similar to this approach: https://christiandietrich.wordpress.com/2011/10/15/xtext-calling-the-generator-from-a-context-menu/, but instead of calling…
user5436266
0
votes
1 answer

Mark Occurrences does not work in xtend editor in Eclipse Mars

Eclipse behaves strange here. I've updated everything. And "Mark Occurrences" works in a normal Java editor, but it does not in and xtend-editor. Do you have any information what's the reason for that? Is this a bug? I've also tried to use the…
armin.miedl
  • 1,070
  • 1
  • 11
  • 16
0
votes
1 answer

How to show an error in the Xtext IDE if a type is referenced before it is declared

We have a custom Xtext-based DSL and generate C++ code from a document written in this DSL via Xtend. Here is a simple example of the DSL: component CMP { type A { B member_1; } type B { string member_1; …
Software Craftsman
  • 2,999
  • 2
  • 31
  • 47
0
votes
1 answer

xtext/xtend use join to create list with multiple fields

I want to print an enum enum State{A(0),B(1)} as a comma seperated list, in the form A=0, B=1. For this xtext/xtend provides a join operation. However, I can't find any information on how to access multiple fields of the enum. The enum has a…
Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
0
votes
1 answer

Using typeof in Xtend

It might be the stupidest question on Xtend. But here it goes I'm trying to convert the following to Xtend if (obj instanceof Integer) { message.reply((Integer)obj); } I know that I would need to use the typeof function. Can I use typeofas a…
David Laberge
  • 15,435
  • 14
  • 53
  • 83
0
votes
1 answer

How to prvent Xtend templates from printing Variables during loop

I am using the Xtend templates to write a small program. I try using the IF statement, but every time I execute it it prints the variable in the console, which I dont want it to. «IF x==y» The jump value is «database.get(2)» …
Goldengirl
  • 957
  • 4
  • 10
  • 30