Thanks for all your kind answers...
I've used Javassist because it's much easier to work in its pseudo-code than in plain bytecode.
1) No, you can't create anonymous or any inner classes (bytecode doesn't have such things, they are all compiled as ordinary classes)
2) Yes, with Javassist you can create, copy, modify and delete methods; you can specify method body and call inside it other methods or create any objects (and more other things in almost the same way as in java source code)
3) I haven't found any source code modification and generation tools, except these (I haven't checked any of them myself, so I'm not sure if they do what is promised):
http://www.fuin.org/srcgen4javassist/examples.html
- A small wrapper for Javassist that can be used to generate source files and bytecode.
http://spoon.gforge.inria.fr/Spoon/HomePage
- Spoon is a Java program processor that fully supports Java 5 and 6. It provides a complete and fine-grained Java metamodel where any program element (classes, methods, fields, statements, expressions...) can be accessed both for reading and modification.
I decided to stick to bytecode generation/modification, so I didn't check those tools. Maybe this topic will help somebody else. No it may be closed, I solved my problem by myself.