Open mickog opened 5 years ago
Hi there,
I am using JCodeModel but cannot find how I can generate a method that returns a call from its super class.
Relevant parts of what I have ..
JDefinedClass jc = jp._class("NewPremiumDTO"); JMethod m = jc.method(JMod.PUBLIC, LP.class, "map"); m.body()._return(m.body().invoke("super"). arg(JExpr.ref("map")));`
JDefinedClass
This will generate 2 lines rather than 1 like this
`super(map);
return super(map);`
inside generated method but I want to generate this line
return super.map(map, this);
Would appreciate help or feedback Thanks
m.body()._return(JExpr.invoke("super").invoke("map"). arg(JExpr.ref("map")).arg(JExpr._this())); for anyone else looking
m.body()._return(JExpr.invoke("super").invoke("map"). arg(JExpr.ref("map")).arg(JExpr._this()));
Hi there,
I am using JCodeModel but cannot find how I can generate a method that returns a call from its super class.
Relevant parts of what I have ..
JDefinedClass
jc = jp._class("NewPremiumDTO"); JMethod m = jc.method(JMod.PUBLIC, LP.class, "map"); m.body()._return(m.body().invoke("super"). arg(JExpr.ref("map")));`This will generate 2 lines rather than 1 like this
`super(map);
return super(map);`
inside generated method but I want to generate this line
return super.map(map, this);
Would appreciate help or feedback Thanks