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

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


        boolean writeBehindEnabled = isWriteBehindEnabled();

        String getAccessName = plasticClass.makeUnique(plasticClass.methodNames, "conduit_get_" + node.name);

        getAccess = new MethodNode(accessForMethod(), getAccessName, "()" + node.desc, null, null);

        InstructionBuilder builder = plasticClass.newBuilder(getAccess);

        // Get the correct FieldConduit object on the stack
View Full Code Here


    {
        ensureNotPublic();

        String setAccessName = plasticClass.makeUnique(plasticClass.methodNames, "reject_field_change_" + node.name);

        setAccess = new MethodNode(accessForMethod(), setAccessName, "(" + node.desc + ")V", null, null);

        String message = String.format("Field %s of class %s is read-only.", node.name, plasticClass.className);

        plasticClass.newBuilder(setAccess).throwException(IllegalStateException.class, message);
View Full Code Here

    {
        String name = plasticClass.makeUnique(plasticClass.methodNames, "shim_set_" + node.name);

        // Takes two Object parameters (instance, and value) and returns void.

        MethodNode mn = new MethodNode(Opcodes.ACC_SYNTHETIC | Opcodes.ACC_FINAL, name, "(" + node.desc + ")V", null, null);

        InstructionBuilder builder = plasticClass.newBuilder(mn);

        builder.loadThis().loadArgument(0).putField(plasticClass.className, node.name, typeName);
        builder.returnResult();
View Full Code Here

    private MethodNode addShimGetAccessMethod()
    {
        String name = plasticClass.makeUnique(plasticClass.methodNames, "shim_get_" + node.name);

        MethodNode mn = new MethodNode(Opcodes.ACC_SYNTHETIC | Opcodes.ACC_FINAL, name, "()" + node.desc, null, null);

        InstructionBuilder builder = plasticClass.newBuilder(mn);

        builder.loadThis().getField(plasticClass.className, node.name, typeName).returnResult();
View Full Code Here

            consTypes.add(type);
        }

        String[] constructorTypes = consTypes.toArray(new String[consTypes.size()]);

        MethodNode cons = new MethodNode(Opcodes.ACC_PUBLIC, PlasticClassImpl.CONSTRUCTOR_NAME, plasticClass.nameCache.toMethodDescriptor("void",
                constructorTypes), null, null);

        InstructionBuilder builder = plasticClass.newBuilder(cons);

        // First three arguments go to the super-class
View Full Code Here

        createReturnValueGetter();
    }

    private InstructionBuilder newMethod(String name, Class returnType, Class... argumentTypes)
    {
        MethodNode mn = new MethodNode(Opcodes.ACC_PUBLIC, name, plasticClass.nameCache.toMethodDescriptor(returnType, argumentTypes),
                null, null);

        invocationClassNode.methods.add(mn);

        return plasticClass.newBuilder(mn);
View Full Code Here

                : 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

            consTypes.add(type);
        }

        String[] constructorTypes = consTypes.toArray(new String[consTypes.size()]);

        MethodNode cons = new MethodNode(Opcodes.ACC_PUBLIC, PlasticClassImpl.CONSTRUCTOR_NAME, plasticClass.nameCache.toMethodDescriptor("void",
                constructorTypes), null, null);

        InstructionBuilder builder = plasticClass.newBuilder(cons);

        // First three arguments go to the super-class
View Full Code Here

        createReturnValueGetter();
    }

    private InstructionBuilder newMethod(String name, Class returnType, Class... argumentTypes)
    {
        MethodNode mn = new MethodNode(Opcodes.ACC_PUBLIC, name, plasticClass.nameCache.toMethodDescriptor(returnType, argumentTypes),
                null, null);

        invocationClassNode.methods.add(mn);

        return plasticClass.newBuilder(mn);
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.