Examples of addPutfield()


Examples of javassist.bytecode.Bytecode.addPutfield()

          bc.addAload(0);
          bc.addAload(0);
          bc.addGetfield(cc, "_counter", "I");
          bc.add(Bytecode.ICONST_1);
          bc.add(Bytecode.IADD);
          bc.addPutfield(cc, "_counter", "I");
          CodeIterator iter = info.getCodeAttribute().iterator();
          iter.begin();
          iter.insert(bc.get());
        }
      }
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

                    if (method.getName().equals("init") &&
                            method.getDescriptor().equals("(Ljavax/servlet/FilterConfig;)V")) {
                        final Bytecode b = new Bytecode(file.getConstPool());
                        b.addAload(0);
                        b.addAload(1);
                        b.addPutfield(ResteasyExtension.FILTER_DISPATCHER, FIELD_NAME, FILTER_FIELD_TYPE);
                        b.addAload(1);
                        b.addInvokeinterface("javax/servlet/FilterConfig", "getServletContext", "()Ljavax/servlet/ServletContext;", 1);
                        b.addAload(0);
                        b.addGetfield(ResteasyExtension.FILTER_DISPATCHER, PARAMETER_FIELD_NAME, SET_TYPE);
                        b.addInvokestatic(CONTEXT_PARAMS, "init", INIT_METHOD_DESC);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

                        b.addAload(0);
                        b.addGetfield(ResteasyExtension.FILTER_DISPATCHER, PARAMETER_FIELD_NAME, SET_TYPE);
                        b.addInvokestatic(CONTEXT_PARAMS, "init", INIT_METHOD_DESC);
                        b.addAload(0);
                        b.add(Opcode.SWAP);
                        b.addPutfield(ResteasyExtension.FILTER_DISPATCHER, PARAMETER_FIELD_NAME, SET_TYPE);
                        method.getCodeAttribute().iterator().insert(b.get());
                        method.getCodeAttribute().computeMaxStack();
                    } else if(method.getName().equals("<init>")) {
                        //no idea why this is needed
                        method.getCodeAttribute().setMaxStack(1);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

                    if (method.getName().equals("init") &&
                            method.getDescriptor().equals("(Ljavax/servlet/ServletConfig;)V")) {
                        final Bytecode b = new Bytecode(file.getConstPool());
                        b.addAload(0);
                        b.addAload(1);
                        b.addPutfield(ResteasyExtension.SERVLET_DISPATCHER, FIELD_NAME, SERVLET_FIELD_TYPE);
                        b.addAload(1);
                        b.addInvokeinterface("javax/servlet/ServletConfig", "getServletContext", "()Ljavax/servlet/ServletContext;", 1);
                        b.addAload(0);
                        b.addGetfield(ResteasyExtension.SERVLET_DISPATCHER, PARAMETER_FIELD_NAME, SET_TYPE);
                        b.addInvokestatic(CONTEXT_PARAMS, "init", INIT_METHOD_DESC);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

                        b.addAload(0);
                        b.addGetfield(ResteasyExtension.SERVLET_DISPATCHER, PARAMETER_FIELD_NAME, SET_TYPE);
                        b.addInvokestatic(CONTEXT_PARAMS, "init", INIT_METHOD_DESC);
                        b.addAload(0);
                        b.add(Opcode.SWAP);
                        b.addPutfield(ResteasyExtension.SERVLET_DISPATCHER, PARAMETER_FIELD_NAME, SET_TYPE);
                        method.getCodeAttribute().iterator().insert(b.get());
                        method.getCodeAttribute().computeMaxStack();
                    } else if(method.getName().equals("<init>")) {
                        method.getCodeAttribute().setMaxStack(1);
                    }
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

                                          HANDLER_SETTER_TYPE);
        minfo.setAccessFlags(AccessFlag.PUBLIC);
        Bytecode code = new Bytecode(cp, 2, 2);
        code.addAload(0);
        code.addAload(1);
        code.addPutfield(classname, HANDLER, HANDLER_TYPE);
        code.addOpcode(Bytecode.RETURN);
        minfo.setCodeAttribute(code.toCodeAttribute());
        cf.addMethod(minfo);
    }
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

        code.addOpcode(Opcode.DUP);
        code.addOpcode(Opcode.IFNONNULL);
        code.addIndex(7);
        code.addOpcode(Opcode.POP);
        code.addGetstatic(NULL_INTERCEPTOR_HOLDER, DEFAULT_INTERCEPTOR, HANDLER_TYPE);
        code.addPutfield(thisClassName, HANDLER, HANDLER_TYPE);

        code.addAload(0);
        int s = addLoadParameters(code, cons.getParameterTypes(), 1);
        code.addInvokespecial(superClass.getName(), "<init>", desc);
        code.addOpcode(Opcode.RETURN);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

        // load this
        code.addAload(0);

        // load param
        code.addDload(1);
        code.addPutfield(ctClass, fieldName, "D");

        code.addOpcode(Opcode.RETURN);

        setter.setCodeAttribute(code.toCodeAttribute());
        setter.setAccessFlags(AccessFlag.PUBLIC);
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

/*      */
/*  877 */     minfo.setAccessFlags(1);
/*  878 */     Bytecode code = new Bytecode(cp, 2, 2);
/*  879 */     code.addAload(0);
/*  880 */     code.addAload(1);
/*  881 */     code.addPutfield(classname, "handler", HANDLER_TYPE);
/*  882 */     code.addOpcode(177);
/*  883 */     minfo.setCodeAttribute(code.toCodeAttribute());
/*  884 */     cf.addMethod(minfo);
/*      */   }
/*      */
View Full Code Here

Examples of javassist.bytecode.Bytecode.addPutfield()

/* 1061 */     Bytecode code = new Bytecode(cp, 0, 0);
/*      */
/* 1066 */     if (doHandlerInit) {
/* 1067 */       code.addAload(0);
/* 1068 */       code.addGetstatic(thisClassName, "default_interceptor", HANDLER_TYPE);
/* 1069 */       code.addPutfield(thisClassName, "handler", HANDLER_TYPE);
/* 1070 */       code.addGetstatic(thisClassName, "default_interceptor", HANDLER_TYPE);
/* 1071 */       code.addOpcode(199);
/* 1072 */       code.addIndex(10);
/*      */     }
/*      */
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.