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
1
vote
1 answer

Xtext strip quotes from string but remain having whitespaces in between words

I'm working on Xtext project and I want to have a grammar that would allow me to: 1. String quotes from strings, ex: "string" -> string 2. Allow to consider a string chunks separated with spaces as one string. I would like to have a following…
1
vote
1 answer

Eclipse XText Object Oriented Grammar

I am a rookie in XText and have built my own scripting language but now I want to start to be able to add stuff like namespaces and new object creation from other classes that are imported and wondering if anyone knows of any open source projects I…
Duncan Krebs
  • 3,366
  • 2
  • 33
  • 53
1
vote
0 answers

Providing Cusom Jars in newly created DSL-Projects in Xtext

this might be a duplicate question (see Xtext Project: Add Jar Libraries with the Project Wizard Manager into the Classpath/Referenced Libaries of the clients Project), but I'm not able to comment on the original one due to low reputation. Therefore…
Stefan
  • 11
  • 1
1
vote
1 answer

How to avoid JvmParameterizedTypeReference: java.util.List when generating methods in Xtext?

In my model I have more objects from which are later generated Java classes. E.g. in one file is defined Object A { operation getList B } And in other file: Object B { operation getList A } 1) From this 2 interfaces should be…
borism
  • 119
  • 2
  • 15
1
vote
1 answer

Xtend operator overloading on existing class

I tried to overload an existing external class's operator with Xtend but it doesn't work. I can't write in the class source, like BigIntegerExtension. How should I do it? Answer The answer is pretty simple. We can override any of the operators what…
Engee
  • 63
  • 7
1
vote
2 answers

how to run xtend TestNg class?

here's Xtend class, I cannot seems to get eclipse to run configuration of this TestNg file I wrote on eclipse xtend. I installed TestNg Plugin as well, but still I don't see a option. How can I run it? Does Xtend Plugin or TestNg plugin requires and…
Njax3SmmM2x2a0Zf7Hpd
  • 1,354
  • 4
  • 22
  • 44
1
vote
1 answer

Is it possible to dynamically generate Java code strings from Xtend strings?

In Java, it's possible to compile and load classes at runtime from source code contained in strings (e.g. using javax.tools.JavaCompiler, EclipseCompiler, or Janino). This process can be entirely in-memory, without writing any temporary files. The…
Jim Pivarski
  • 5,568
  • 2
  • 35
  • 47
1
vote
1 answer

sorting xtext AST through quickfix

I've Been Trying to change the order of nodes through quickfix, but something is wrong. Here's my code in xtend: @Fix(org.xtext.custom.conventions.validation.ConventionsValidator::CONVENTION_NOT_ORDERED) def fixFeatureName( Issue issue, …
Eran
  • 360
  • 2
  • 12
1
vote
1 answer

creating a simple domain-specific language using xtext-xbase-xtend toolchain

This is for a class project for creating a domain-specific language (DSL). Nothing fancy to consider. For myself, I've set this project as purely an exercise to learning the steps involved. Files involved (with attached code files):: 1)…
apil.tamang
  • 2,545
  • 7
  • 29
  • 40
1
vote
1 answer

What is the different between these two Eobjects generated from the same resource

I don't understand why there are two different EObjects that (for me) should mean the same thing var script1 = resource.getContents().get(0) as Script var script2 = resource.parseResult.rootASTElement as Script They seem to contain different…
tgoossens
  • 9,676
  • 2
  • 18
  • 23
1
vote
1 answer

Xtend build fails, with java containing invalid characters

All of a sudden, the Java classes being generated by Xtend seem to contain invalid syntax. eg: public Long getEntityId() { return ??field.simpleName??; } where previously the syntax was generated correctly: public Long getEntityId() { …
Marty Pitt
  • 28,822
  • 36
  • 122
  • 195
1
vote
2 answers

Xtend picks the wrong overload

I'm playing with Xtend, and have hit a roadblock. My class uses a Spring Data repository. Here's the interface: public interface UserRepository extends GraphRepository, RelationshipOperationsRepository { public UserNode…
Marty Pitt
  • 28,822
  • 36
  • 122
  • 195
1
vote
2 answers

Callback function in xtend

How can I call a callback function in xtend? I am looking for something similar to the one in C. Example: struct callbacks { char name[10]; boolean (*pfState)(); }; static const struct callbacks call[] = { …
chris yo
  • 1,187
  • 4
  • 13
  • 30
1
vote
1 answer

Rewrite anonymous inner class to a closure (Java -> xtend)

How can I rewrite my test method to xtend? I've tried several things, but I'm failing. Class written in xtend import com.google.common.base.Function class Generator { @Property Function generateSomething; generateFoo() { …
GarfieldKlon
  • 11,170
  • 7
  • 31
  • 33
1
vote
4 answers

How to install Xtend 2.4 for Android?

I'm trying follow this article When I try to 'Disable the checkbox Contact all update sites during install to find required software, to avoid unwanted updates of other Eclipse plug-ins.' I can't to make next steps because Cannot complete the…
falcon
  • 372
  • 3
  • 19