Examples of MethodInvocation


Examples of org.eclipse.jdt.core.dom.MethodInvocation

     *
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createLocalStaticMethodCall(String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation

     * @param cname fully qualified class name
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createStaticMethodCall(String cname, String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setExpression(getAST().newName(cname));
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation

     * @param name local variable or field name
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createNormalMethodCall(String name, String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setExpression(getAST().newSimpleName(name));
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation

     * @param expr instance expression
     * @param mname method name
     * @return builder
     */
    public InvocationBuilder createExpressionMethodCall(ExpressionBuilderBase expr, String mname) {
        MethodInvocation methcall = getAST().newMethodInvocation();
        methcall.setExpression(expr.getExpression());
        methcall.setName(getAST().newSimpleName(mname));
        return new InvocationBuilder(this, methcall);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.MethodInvocation

     * @param type variable type (must be an iterator subclass or generic type)
     * @param init variable initialization expression
     * @param block statement body block
     */
    public void addIteratedForStatement(String name, Type type, ExpressionBuilderBase init, BlockBuilder block) {
        MethodInvocation methcall = m_ast.newMethodInvocation();
        methcall.setExpression(m_ast.newSimpleName(name));
        methcall.setName(m_ast.newSimpleName("hasNext"));
        addForStatement(name, type, init.getExpression(), methcall, null, block);
    }
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.nodes.MethodInvocation

    ASTRewrite rewriter = ASTRewrite.create(ast);
   
    ListRewrite classListRewrite = rewriter.getListRewrite( fCoveringDeclarationFinder.getCoveringClassDeclaration().getBody(), Block.STATEMENTS_PROPERTY);
    VariableBase dispatcher = ast.newVariable(THIS_VARIABLE_NAME);
    FunctionInvocation calledExtractedMethod = ast.newFunctionInvocation(ast.newFunctionName(ast.newIdentifier(fMethodName)), computeParameters(ast));
    MethodInvocation inlineMethodCall = ast.newMethodInvocation(dispatcher, calledExtractedMethod);

    List<List<ASTNode>> Occurences = new ArrayList<List<ASTNode>>();
   
    if(fReplaceDuplicates) {
      for(Match replace : fDuplicates) {
View Full Code Here

Examples of org.gradle.messaging.dispatch.MethodInvocation

            RemoteMethodInvocation remoteMethodInvocation = (RemoteMethodInvocation) message;
            Method method = methods.get(remoteMethodInvocation.getKey());
            if (method == null) {
                throw new IllegalStateException("Received a method invocation message for an unknown method.");
            }
            MethodInvocation methodInvocation = new MethodInvocation(method,
                    remoteMethodInvocation.getArguments());
            dispatch.dispatch(methodInvocation);
        } else {
            throw new IllegalStateException(String.format("Received an unknown message %s.", message));
        }
View Full Code Here

Examples of org.gradle.messaging.dispatch.MethodInvocation

        }});

        broadcast.add(listener1);
        broadcast.add(listener2);

        MethodInvocation invocation = new MethodInvocation(TestListener.class.getMethod("event1", String.class), new Object[] { "param" });
        broadcast.dispatch(invocation);
    }
View Full Code Here

Examples of org.gradle.messaging.dispatch.MethodInvocation

    @Test
    public void canUseDispatchToReceiveNotifications() throws NoSuchMethodException {
        final Dispatch<MethodInvocation> dispatch1 = context.mock(Dispatch.class, "listener1");
        final Dispatch<MethodInvocation> dispatch2 = context.mock(Dispatch.class, "listener2");
        final MethodInvocation invocation = new MethodInvocation(TestListener.class.getMethod("event1", String.class), new Object[] { "param" });

        context.checking(new Expectations() {{
            one(dispatch1).dispatch(invocation);
            one(dispatch2).dispatch(invocation);
        }});
View Full Code Here

Examples of org.gradle.messaging.dispatch.MethodInvocation

        }});

        broadcast.add(listener);

        try {
            broadcast.dispatch(new MethodInvocation(TestListener.class.getMethod("event1", String.class), new Object[]{"param"}));
            fail();
        } catch (ListenerNotificationException e) {
            assertThat(e.getMessage(), equalTo("Failed to notify test listener."));
            assertThat(e.getCause(), sameInstance((Throwable) failure));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.