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

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


        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(ACC_SYNTHETIC | 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 = newBuilder(mn);
View Full Code Here


        private void replaceFieldWriteAccess(String conduitFieldName)
        {
            String setAccessName = makeUnique(methodNames, "set_" + node.name);

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

            InstructionBuilder builder = newBuilder(setAccess);

            pushFieldConduitOntoStack(conduitFieldName, builder);
View Full Code Here

        {
            boolean writeBehindEnabled = isWriteBehindEnabled();

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

            getAccess = new MethodNode(ACC_SYNTHETIC | ACC_FINAL, getAccessName, "()" + node.desc, null, null);

            InstructionBuilder builder = newBuilder(getAccess);

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

        private void makeReadOnly()
        {
            String setAccessName = makeUnique(methodNames, "setfieldvalue_" + node.name);

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

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

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

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

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

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

            InstructionBuilder builder = newBuilder(mn);

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

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

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

            InstructionBuilder builder = newBuilder(mn);

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

                consTypes.add(type);
            }

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

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

            InstructionBuilder builder = 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(ACC_PUBLIC, name, nameCache.toMethodDescriptor(returnType, argumentTypes),
                    null, null);

            invocationClassNode.methods.add(mn);

            return 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 & ~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 void replaceFieldWriteAccess(String conduitFieldName)
    {
        String setAccessName = plasticClass.makeUnique(plasticClass.methodNames, "set_" + node.name);

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

        InstructionBuilder builder = plasticClass.newBuilder(setAccess);

        pushFieldConduitOntoStack(conduitFieldName, builder);
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.