I need to add this is a class or this is a method in a text/java file before class name or method name (line no is available through japa).
I have tried all possible cases I can, try to edit text/Java file with file reader/writer (but it always append at the end ,and want above class/method name), pmd, japa (can read but can't find option to edit) and random access files interface (can edit too but it don't append instead overrides character).
Nothing has helped so far, is there any way I can achieve this?
For example, the original source code:
import java.lang.*;
class test1{
public static void main(String[] args) {
System.out.println("hello world");
}
}
after
import java.lang.*;
/*this is a class*/
class test1{
/*this is a method*/
public static void main(String[] args) {
System.out.println("hello world");
}
}