Basically, if you have detailed knowledge of Java bytecode/class file,
you can do all the three things with the lower-level API of Javassist.
If you want to use only higher-level API, then
> 1. retrieve all the variable names and its corresponding values
> (global variables, and local variables) ?
You can obtain not local variable names but all the fields.
> 2. can I insert a statement into a specific line within a method?
> 3. can I modify a specific statement ?
The answer depends on the kind of statement.
You can modify method calls, field accesses, etc but not all the kinds.