Package org.objectweb.asm

Examples of org.objectweb.asm.ClassWriter.visitEnd()


        // dispatch input events method
        generateEventDispatchMethod(cw, "dispatchEvent", inputEventHierarchies, "onEvent");
        // dispatch output events method
        generateEventDispatchMethod(cw, "dispatchTrigger", outputEventHierarchies, "onTrigger");

        cw.visitEnd();

        if (DUMP) {
            try {
                LoggerFactory.getLogger(getClass()).debug(
                        "Dumping generated overload dispatcher class for PE of class [" + targetClass + "]");
View Full Code Here


    mv.visitVarInsn(Opcodes.ALOAD, 6);
    mv.visitFieldInsn(Opcodes.PUTFIELD, name, names[4], "Lnet/minecraft/logging/ILogAgent;");
    mv.visitInsn(Opcodes.RETURN);
    mv.visitMaxs(11, 10);
    mv.visitEnd();
    cw.visitEnd();
    return cw.toByteArray();
  }

  private byte[] writeWorldServer(String name, String transformedName, byte[] bytes, ClassReader cr)
  {
View Full Code Here

    mv.visitInsn(Opcodes.ACONST_NULL);
    mv.visitFieldInsn(Opcodes.PUTFIELD, name, names[3], "Lnet/minecraft/world/Teleporter;");
    mv.visitInsn(Opcodes.RETURN);
    mv.visitMaxs(11, 10);
    mv.visitEnd();
    cw.visitEnd();
    return cw.toByteArray();
  }

  private boolean implement(ClassNode cn)
  {
View Full Code Here

            if ((methods[i].getModifiers() & (Modifier.STATIC | Modifier.FINAL)) == 0) {
                generateDelegator(cw, methods[i], className, internalClassName);
            }
        }

        cw.visitEnd();

        return cw.toByteArray();

    }
View Full Code Here

      gm.loadLocal(writerLocal);
      gm.returnValue();
      gm.endMethod();
    }

    cw.visitEnd();
    Class<?> aClass = GuardCompiler.defineClass(className, cw.toByteArray());
    try {
      return (CompiledCodes) aClass.getConstructor(Code[].class).newInstance(new Object[] {newcodes});
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    // Close the static initializer
    sm.returnValue();
    sm.endMethod();

    cw.visitEnd();
    Class<?> aClass = defineClass(className, cw.toByteArray());
    return (Guard) aClass.getConstructor(Object[].class).newInstance((Object) cargs.toArray(new Object[cargs.size()]));
  }

  private static final DefiningClassLoader cl = new DefiningClassLoader(Thread.currentThread().getContextClassLoader());
View Full Code Here

            mv.visitLdcInsn(message);
            mv.visitInsn(ARETURN);
            mv.visitMaxs(1, 0);
            mv.visitEnd();

            cw.visitEnd();
            return cw.toByteArray();
        }

    }
View Full Code Here

        for (MessagePartInfo mpi : messageInfo.getMessageParts()) {
            generateMessagePart(cw, mpi, method, classFileName);
        }

        cw.visitEnd();

        Class<?> clz = loadClass(className, method.getDeclaringClass(), cw.toByteArray());
        wrapperPart.setTypeClass(clz);
        wrapperBeans.add(clz);
    }
View Full Code Here

        av0.visit("namespace", ns);
        av0.visitEnum("elementFormDefault",
                      getClassCode(XmlNsForm.class),
                      q ? "QUALIFIED" : "UNQUALIFIED");
        av0.visitEnd();
        cw.visitEnd();

        loadClass(className, clz, cw.toByteArray());
    }

    private void generateMessagePart(ClassWriter cw, MessagePartInfo mpi, Method method, String className) {
View Full Code Here

        for (Method method : interfaze.getMethods()) {
            if (!(method.getDeclaringClass() == Object.class)) {
                generateMethod(cw, interfaceName, className, method, consumes, produces);
            }
        }
        cw.visitEnd();

        return cw.toByteArray();
    }

    // public <ReturnType> method(<Type0> arg0, ..., <TypeN> argN) throws <ExpectionType0>, ..., <ExceptionTypeK>
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.