Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » JvmTypesBuilder generate final parameters
JvmTypesBuilder generate final parameters [message #1002252] Fri, 18 January 2013 03:52 Go to previous message
Davide Poletti is currently offline Davide Poletti
Messages: 4
Registered: August 2009
Junior Member
Im'm tring to generate, using the Xtend Xbase API, a simple Java mathod.
This is the Xtend code.

var jvmMethod = element.toMethod("fromSap",element.newTypeRef(element.dtoFullName))[
						var jvmTypeReference= fromSap.sapType;
						
						var param = toParameter("sapOb",jvmTypeReference)
						parameters+=param
						body = ['''....''')]



everything works fine except the parameter that has the final modifier.
This is the generated code:

public class DTOTest {
  public DTOTest fromSap(final String sapOb) {
    DTOTest result = new DTOTest();
    return result;
    
  }
}



I tried to add:

	param.setFinal(false);

but I got

This expression is not allowed in this context, since it doesn't cause any side effects.


at compile time

Can someone help me to remove the final modifier from the generated code?

Davide

[Updated on: Fri, 18 January 2013 03:59]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic:How to trigger the serializer on existing EMF model?
Next Topic:Setting linking diagnostics to ignore?
Goto Forum:
  


Current Time: Thu May 23 14:40:00 EDT 2013

Powered by FUDForum. Page generated in 0.10159 seconds