Tests of Javassist
-
Generating a Java Class. Creation of a new class with an interface New field added
-
Loading Bytecode Instructions of Class.
-
Adding Fields to Existing Class Bytecode get Point.class add a field ascertainment : get fields of the class
-
Adding Constructor to Class Bytecode. with and without parameters
-
Class loading, add method(by copy) & update of the class
-
the users can attach a metaobject to an object. The metaobject can control the behavior of the object. -to work more-
-
"The verbose metaobject" : reflexive programming. This program dynamically attaches a metaobject to a class. This class is controlled by the metaobject.
http://www.javassist.org/
Docs: http://www.javassist.org/html
tutorial : https://github.com/jboss-javassist/javassist/wiki/Tutorial-1
Code Sample : https://github.com/jboss-javassist/javassist/tree/master/sample
IBM course ondynamic programation:
https://www.ibm.com/developerworks/library/j-dyn0916/index.html
1hour Video conf on javassist (russian with subtitle in any language) :
https://jeeconf.com/program/having-fun-with-javassist/
https://dzone.com/articles/practical-introduction-code
(or same under another link : https://theholyjava.wordpress.com/2011/09/07/practical-introduction-into-code-injection-with-aspectj-javassist-and-java-proxy/)
Quick overview: https://www.baeldung.com/javassist
https://artisan.karma-lab.net/javassist-et-instrumentation-dynamique
Javassist + ASM: https://blog.newrelic.com/engineering/diving-bytecode-manipulation-creating-audit-log-asm-javassist/