hello ppl...
I have previously used javaassist to create new beans on the fly but had run into some problems with a new feature i was trying to implement.
This time the class byte-code obtained from the toBytecode() function is stored in a object repository implementing a raw version control scheme on it. I am also using a custom class loader to make "Class" objects out of the required version of the byte-code and then make objects of that class.
Now I also wanted to implement a byte-code editing utility for this repository. This utility should take input in form of byte[] arrays, perform the specified modification and then write the byte[] back to the repository.
so now how do i edit the class represented by the byte-code in the byte[] array ??
i am in a total fix....it seems the effort in making the repository was a total waste especially if i cannot edit the class.
any one having a clue on how to do this ? Have i missed some feature of javassist ?
any help shall be highly appreciated.
You can use javassist.ByteArrayClassPath.
For better performance, you should define
your own ClassPath class, though.
For more details, please see the API docs
of ByteArrayClassPath and ClassPath.