Examples of invokeMethod()


Examples of groovy.lang.GroovyObject.invokeMethod()

    }

    public void testBytecode3Bug() throws Exception {
        GroovyObject object = compile("src/test/groovy/bugs/Bytecode3Bug.groovy");
        //object.invokeMethod("testInject", null);
        object.invokeMethod("testIncrementPropertyInclosure", null);
    }

    public void testBytecode4Bug() throws Exception {
        GroovyObject object = compile("src/test/groovy/bugs/Bytecode4Bug.groovy");
        object.invokeMethod("testInject", null);
View Full Code Here

Examples of groovy.lang.GroovyObjectSupport.invokeMethod()

        ant.withClasspath(combinedClasspath).execute(new Closure<Object>(this, this) {
            @SuppressWarnings("UnusedDeclaration")
            public Object doCall(Object it) {
                final GroovyObjectSupport antBuilder = (GroovyObjectSupport) it;

                antBuilder.invokeMethod("taskdef", ImmutableMap.of(
                        "name", "groovydoc",
                        "classname", "org.codehaus.groovy.ant.Groovydoc"
                ));

                antBuilder.invokeMethod("groovydoc", new Object[]{args, new Closure<Object>(this, this) {
View Full Code Here

Examples of groovy.lang.MetaClass.invokeMethod()

      return invokeBeanDefiningMethod(name, args);
    }
        WebApplicationContext ctx = springConfig.getUnrefreshedApplicationContext();
        MetaClass mc = DefaultGroovyMethods.getMetaClass(ctx);
        if(!mc.respondsTo(ctx, name, args).isEmpty()){
            return mc.invokeMethod(ctx,name, args);
        }
        return this;
  }

    public WebApplicationContext createApplicationContext() {
View Full Code Here

Examples of groovy.lang.MetaClass.invokeMethod()

   * @see ObjectFactoryInterceptor#isPassParentToConstructor()
   */
  public void associate(GroovyBuilder builder, ObjectFactoryInterceptor ofi, Object child, Object parent) {
    if (parent != null) {
      MetaClass pmc = InvokerHelper.getMetaClass(child.getClass());
      pmc.invokeMethod(parent, "addChild", new Object[] { parent });
    }
   
    MetaClass cmc = InvokerHelper.getMetaClass(child.getClass());
    cmc.invokeMethod(child, "setParent", new Object[] { parent });
  }
View Full Code Here

Examples of groovy.lang.MetaClass.invokeMethod()

      MetaClass pmc = InvokerHelper.getMetaClass(child.getClass());
      pmc.invokeMethod(parent, "addChild", new Object[] { parent });
    }
   
    MetaClass cmc = InvokerHelper.getMetaClass(child.getClass());
    cmc.invokeMethod(child, "setParent", new Object[] { parent });
  }

}
View Full Code Here

Examples of groovy.lang.MetaClass.invokeMethod()

   * @see ObjectFactoryInterceptor#isPassParentToConstructor()
   */
  public void associate(GroovyBuilder builder, ObjectFactoryInterceptor ofi, Object child, Object parent) {
    if (parent != null) {
      MetaClass pmc = InvokerHelper.getMetaClass(child.getClass());
      pmc.invokeMethod(parent, "addChild", new Object[] { parent });
    }
   
    MetaClass cmc = InvokerHelper.getMetaClass(child.getClass());
    cmc.invokeMethod(child, "setParent", new Object[] { parent });
  }
View Full Code Here

Examples of groovy.lang.MetaClass.invokeMethod()

      MetaClass pmc = InvokerHelper.getMetaClass(child.getClass());
      pmc.invokeMethod(parent, "addChild", new Object[] { parent });
    }
   
    MetaClass cmc = InvokerHelper.getMetaClass(child.getClass());
    cmc.invokeMethod(child, "setParent", new Object[] { parent });
  }

}
View Full Code Here

Examples of groovy.lang.Script.invokeMethod()

            Script script = InvokerHelper.createScript(GroovyUtil.getScriptClassFromLocation(this.getLocation(modelService)), GroovyUtil.getBinding(gContext));
            Object resultObj = null;
            if (UtilValidate.isEmpty(modelService.invoke)) {
                resultObj = script.run();
            } else {
                resultObj = script.invokeMethod(modelService.invoke, EMPTY_ARGS);
            }
            if (resultObj != null && resultObj instanceof Map<?, ?>) {
                return cast(resultObj);
            } else if (gContext.get("result") != null && gContext.get("result") instanceof Map<?, ?>) {
                return cast(gContext.get("result"));
View Full Code Here

Examples of groovy.lang.Script.invokeMethod()

        Script script = InvokerHelper.createScript(getScriptClassFromLocation(location, groovyClassLoader), getBinding(context));
        Object result = null;
        if (UtilValidate.isEmpty(methodName)) {
            result = script.run();
        } else {
            result = script.invokeMethod(methodName, new Object[] { context });
        }
        return result;
    }

    public static Object runScriptFromClasspath(String script, Map<String,Object> context) throws GeneralException {
View Full Code Here

Examples of groovy.util.NodeBuilder.invokeMethod()

            }
        };

        content.setDelegate(nodes);
        content.setResolveStrategy(Closure.DELEGATE_FIRST);
        Node root = (Node) nodes.invokeMethod(getName(), content);

        for (Node child : (List<Node>) root.children()) {
            dom.addChild(nodeToXpp3(child));
        }
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.