类 MethodWriter


  • public class MethodWriter
    extends Object
    utility class to compile methods and add the to class files
    作者:
    Luis Barreiro
    • 方法详细资料

      • write

        public static javassist.CtMethod write​(javassist.CtClass target,
                                               String format,
                                               Object... args)
                                        throws javassist.CannotCompileException
        convenience method that builds a method from a format string. {@see String.format} for more details
        抛出:
        javassist.CannotCompileException
      • addGetter

        public static javassist.CtMethod addGetter​(javassist.CtClass target,
                                                   String field,
                                                   String name)
      • addSetter

        public static javassist.CtMethod addSetter​(javassist.CtClass target,
                                                   String field,
                                                   String name)
      • addMethod

        public static int addMethod​(javassist.bytecode.ConstPool cPool,
                                    javassist.CtMethod method)