Package org.apache.tapestry5.internal.plastic.asm.tree

Examples of org.apache.tapestry5.internal.plastic.asm.tree.MethodNode


                : advisedMethodNode.exceptions.toArray(new String[0]);

        // Remove the private flag, so that the MethodInvocation implementation (in the same package)
        // can directly access the method without an additional access method.

        MethodNode mn = new MethodNode(advisedMethodNode.access & ~Opcodes.ACC_PRIVATE, newMethodName,
                advisedMethodNode.desc, advisedMethodNode.signature, exceptions);

        // Copy everything else about the advisedMethodNode over to the new node

        advisedMethodNode.accept(mn);
View Full Code Here


    private String createAccessMethod()
    {
        String name = String.format("%s$access%s", node.name, PlasticUtils.nextUID());

        // Kind of awkward that exceptions are specified as String[] when what we have handy is List<String>
        MethodNode mn = new MethodNode(Opcodes.ACC_SYNTHETIC | Opcodes.ACC_FINAL, name, node.desc, node.signature, null);
        // But it is safe enough for the two nodes to share
        mn.exceptions = node.exceptions;

        InstructionBuilder builder = plasticClass.newBuilder(mn);
View Full Code Here

        Collections.sort(fields);

        // TODO: Make the output class's constructor protected, and create a shim class to instantiate it
        // efficiently (without reflection).
        newConstructor = new MethodNode(ACC_PUBLIC, CONSTRUCTOR_NAME, CONSTRUCTOR_DESC, null, null);
        constructorBuilder = newBuilder(newConstructor);

        // Start by calling the super-class no args constructor

        if (parentMethodBundle.isTransformed())
View Full Code Here

            constructorBuilder.loadThis().invokeVirtual(className, "void", initializerName);

            // And replace it with a constructor that throws an exception

            MethodNode replacementConstructor = new MethodNode(originalAccess, CONSTRUCTOR_NAME, NOTHING_TO_VOID, null,
                    null);

            newBuilder(replacementConstructor).throwException(IllegalStateException.class, invalidConstructorMessage());

            classNode.methods.add(replacementConstructor);
View Full Code Here

        for (int i = 0; i < exceptions.length; i++)
        {
            exceptions[i] = PlasticInternalUtils.toInternalName(description.checkedExceptionTypes[i]);
        }

        MethodNode methodNode = new MethodNode(description.modifiers, description.methodName, desc,
                description.genericSignature, exceptions);
        boolean isOverride = methodBundle.isImplemented(methodNode.name, desc);

        if (isOverride)
            createOverrideOfBaseClassImpl(description, methodNode);
View Full Code Here

        return instantiateShim(shimClassNode);
    }

    private void implementConstructor(ClassNode shimClassNode)
    {
        MethodNode mn = new MethodNode(ACC_PUBLIC, CONSTRUCTOR_NAME, NOTHING_TO_VOID, null, null);

        InstructionBuilder builder = newBuilder(mn);

        builder.loadThis().invokeConstructor(PlasticClassHandleShim.class).returnResult();
View Full Code Here

        }
    }

    private void implementShimGet(ClassNode shimClassNode)
    {
        MethodNode mn = new MethodNode(ACC_PUBLIC, "get", OBJECT_INT_TO_OBJECT, null, null);

        InstructionBuilder builder = newBuilder(mn);

        // Arg 0 is the target instance
        // Arg 1 is the index
View Full Code Here

        shimClassNode.methods.add(mn);
    }

    private void implementShimSet(ClassNode shimClassNode)
    {
        MethodNode mn = new MethodNode(ACC_PUBLIC, "set", OBJECT_INT_OBJECT_TO_VOID, null, null);

        InstructionBuilder builder = newBuilder(mn);

        // Arg 0 is the target instance
        // Arg 1 is the index
View Full Code Here

        shimClassNode.methods.add(mn);
    }

    private void implementShimInvoke(ClassNode shimClassNode)
    {
        MethodNode mn = new MethodNode(ACC_PUBLIC, "invoke", OBJECT_INT_OBJECT_ARRAY_TO_METHOD_INVOCATION_RESULT, null,
                null);

        InstructionBuilder builder = newBuilder(mn);

        // Arg 0 is the target instance
View Full Code Here

            if (!fnode.owner.equals(classNode.name))
                continue;

            Map<String, MethodNode> fieldToMethod = opcode == GETFIELD ? fieldToReadMethod : fieldToWriteMethod;

            MethodNode mn = fieldToMethod.get(fnode.name);

            if (mn == null)
                continue;

            String methodDescription = opcode == GETFIELD ? "()" + fnode.desc : "(" + fnode.desc + ")V";
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.internal.plastic.asm.tree.MethodNode

Copyright © 2018 www.massapicom. 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.