Class LibraryClassEditor


  • public class LibraryClassEditor
    extends java.lang.Object
    This class can add interfaces and class members to a given class. Elements to be added must be filled out beforehand, including their references to the constant pool.
    • Constructor Summary

      Constructors 
      Constructor Description
      LibraryClassEditor​(LibraryClass targetClass)
      Creates a new ClassEditor that will edit elements in the given target class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addField​(Field field)
      Adds the given field.
      void addInterface​(java.lang.String interfaceName, Clazz referencedInterface)
      Adds the given interface.
      void addMethod​(Method method)
      Adds the given method.
      void removeField​(Field field)
      Removes the given field.
      void removeInterface​(java.lang.String interfaceName)
      Removes the given interface.
      void removeMethod​(Method method)
      Removes the given method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LibraryClassEditor

        public LibraryClassEditor​(LibraryClass targetClass)
        Creates a new ClassEditor that will edit elements in the given target class.
    • Method Detail

      • addInterface

        public void addInterface​(java.lang.String interfaceName,
                                 Clazz referencedInterface)
        Adds the given interface.
      • removeInterface

        public void removeInterface​(java.lang.String interfaceName)
        Removes the given interface.
      • addField

        public void addField​(Field field)
        Adds the given field.
      • removeField

        public void removeField​(Field field)
        Removes the given field. Note that removing a field that is still being referenced can cause unpredictable effects.
      • addMethod

        public void addMethod​(Method method)
        Adds the given method.
      • removeMethod

        public void removeMethod​(Method method)
        Removes the given method. Note that removing a method that is still being referenced can cause unpredictable effects.