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, "getfieldvalue_" + node.name);

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

        InstructionBuilder builder = plasticClass.newBuilder(getAccess);

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


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

        setAccess = new MethodNode(Opcodes.ACC_SYNTHETIC | Opcodes.ACC_FINAL, 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, "shimset_" + 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, "shimget_" + 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

        final String name,
        final String desc,
        final MethodVisitor mv,
        final Map labels)
    {
        this(new MethodNode(access, name, desc, null, null) {
            public void visitEnd() {
                Analyzer a = new Analyzer(new BasicVerifier());
                try {
                    a.analyze("dummy", this);
                } catch (Exception e) {
View Full Code Here

        for (Iterator i = cn.interfaces.iterator(); i.hasNext();) {
            interfaces.add(Type.getObjectType(i.next().toString()));
        }

        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            SimpleVerifier verifier = new SimpleVerifier(Type.getObjectType(cn.name),
                    syperType,
                    interfaces,
                    (cn.access | Opcodes.ACC_INTERFACE) != 0);
            Analyzer a = new Analyzer(verifier);
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

    {
        this.parent = parent;
        this.transformer = transformer;
        this.logger = logger;
        this.internalRequestGlobals = internalRequestGlobals;
        this.changeTracker = new URLChangeTracker(classpathURLConverter);

        initializeService();
    }
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.