Could I add the comments to my java class with the BCEL?
1.Could I add the comments to my existing java class with the BCEL? 2.Could I add the comments to my newly manually generated java class with t开发者_JAVA技巧he BCEL?
BCEL manipulates byte code. Byte code doesn't contain any comments.
Comments from the Java source code aren't stored in compiled class files (ie bytecode). However you can use annotatons on class, field or method level to store some comments to bytecode. You can also use a custom bytecode attribute to store comments or any other custom information inside bytecode.
Comments are stripped out and ignored by the compiler and not placed in the resulting bytecode (this is probably true for every compiled language). There is no way to put Java comments in bytecode. BCEL won't help you here.
精彩评论