How to generate comment inside a method with JCodeModel

634 Views Asked by At

I need something like this

public void method() {
    //TODO generated sources
}

Here is how I generate a class and a method

JCodeModel cm = new JCodeModel();
JDefinedClass dc = cm._class("MyClass");
JMethod method = dc.method(JMod.PUBLIC, cm.VOID,"method");
1

There are 1 best solutions below

0
On

adding method.body().directStatement("//TODO generated sources"); worked