0

I'm trying to use sun-codemodel to generate source code, checking the API for a long time however no luck.

  JBlock body2 = method2.body();

  JInvocation arg = body2.invoke( "a" ).arg( xxx ).invoke( "c" ).arg( xxx );

only generate the first part, i.e. a(xxx)

Any ideas?

4

1 回答 1

0

通过使用解决的问题

      JInvocation invoke = JExpr._this()
                .invoke( "fun" )
                .arg( "arg1" )
                .invoke( "fun2" )
                .arg( "arg2" );
method.body().add(invoke);
于 2012-04-08T12:10:30.567 回答