Tuesday, 21 April 2020

Javassist tutorial

      Introduction to Javassist
      Write .class file of a class to a file
      Add super class to a class
      Get the modified byte code
      Define new class at run time
      Add fields to new class
      Add non-primitive fields to a class
      Add field of type list to a class
      Add static field to a class
      Remove a field from class
      Add methods to the new class
      Modify type of instance field
      Add new method and invoke it for an existing class
      Create new interface at run time
      Dealing with Frozen classes
      Pruning: Discard unnecessary information
      Get CtClass object from byte array
      Get CtClass object from .class file
      Get CtClass object from InputStream
      Remove CtClass object from ClassPool
      Add new fields to existing class
      Add methods to existing class
      Remove a method from an existing class
      Add an annotation to a run time generated class
      Add an annotation to a run time generated method
      Replace content of a method at run time
      Create proxy to a class
      check whether object is proxy?
      Add dynamically generated classes to a package
      Create new instance from CtClass
      Create copy of a class
      Create new instance from CtClass

Previous                                                    Next                                                    Home

No comments:

Post a Comment