Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.MethodNode


        node.desc = "(Lmy/Service;Ljava/util/Dictionary;)V";
        assertEquals("my.Service", getMethodIdentifier(node));
    }

    public void testSpecificationRecognizedWithServiceReference() throws Exception {
        MethodNode node = new MethodNode();
        node.name = "handle";
        node.desc = "(Lmy/Service;Lorg/osgi/framework/ServiceReference;)V";
        assertEquals("my.Service", getMethodIdentifier(node));
    }
View Full Code Here


        node.desc = "(Lmy/Service;Lorg/osgi/framework/ServiceReference;)V";
        assertEquals("my.Service", getMethodIdentifier(node));
    }

    public void testSpecificationRecognizedOnlyMap() throws Exception {
        MethodNode node = new MethodNode();
        node.name = "handle";
        node.desc = "(Ljava/util/Map;)V";
        assertNull(getMethodIdentifier(node));
    }
View Full Code Here

        node.desc = "(Ljava/util/Map;)V";
        assertNull(getMethodIdentifier(node));
    }

    public void testSpecificationRecognizedOnlyDictionary() throws Exception {
        MethodNode node = new MethodNode();
        node.name = "handle";
        node.desc = "(Ljava/util/Dictionary;)V";
        assertNull(getMethodIdentifier(node));

    }
View Full Code Here

        assertNull(getMethodIdentifier(node));

    }

    public void testSpecificationRecognizedOnlyServiceReference() throws Exception {
        MethodNode node = new MethodNode();
        node.name = "handle";
        node.desc = "(Lorg/osgi/framework/ServiceReference;)V";
        assertNull(getMethodIdentifier(node));
    }
View Full Code Here

        assertTrue(matcher.matches(selection.get()));
    }

    private MethodNode methodNode() {
        return new MethodNode(0, "method", "(java/lang/String)V", null, null);
    }
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

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

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

        if (isOverride)
            createOverrideOfBaseClassImpl(description, methodNode);
        else
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

TOP

Related Classes of org.objectweb.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.