Examples of invokeMethod()


Examples of grails.spring.BeanBuilder.invokeMethod()

        return application.getParentContext();
    }

    public BeanBuilder beans(Closure closure) {
        BeanBuilder bb = new BeanBuilder(getParentCtx(), new GroovyClassLoader(application.getClassLoader()));
        bb.invokeMethod("beans", new Object[]{closure});
        return bb;
    }

    public void doWithApplicationContext(ApplicationContext ctx) {
        Object[] args = {ctx};
View Full Code Here

Examples of groovy.lang.Binding.invokeMethod()

      else break;
    }
    if (method == null) {
      try {
        Binding dsl = GroovyDSLBinding.getInstance();
        if (dsl != null) return dsl.invokeMethod(methodName, arguments); else throw me;
      } catch (MissingMethodException eee) {
        throw me;
      }
    }
    try {
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

        assertThat(groovyObject.getMetaClass(), notNullValue());

        groovyObject.setProperty("prop", "value");
        assertThat(bean.getProp(), equalTo("value"));
        assertThat(groovyObject.getProperty("prop"), equalTo((Object) "value"));
        assertThat(groovyObject.invokeMethod("doStuff", new Object[]{"some value"}), equalTo((Object) "{some value}"));
    }

    @Test
    public void cachesGeneratedSubclass() {
        assertSame(generator.generate(Bean.class), generator.generate(Bean.class));
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

            final GroovyObject groovyObject = (GroovyObject)groovyClass.newInstance();

            this.copyProperties(
                this.stub,
                groovyObject);
            return groovyObject.invokeMethod(
                methodName,
                args);
        }
        catch (final Throwable throwable)
        {
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

    {
      ClassLoader parent = WrapperGroovyMain.class.getClassLoader();
      GroovyClassLoader loader = new GroovyClassLoader(parent);
      Class groovyClass = loader.parseClass(scriptFile);
      GroovyObject script = (GroovyObject) groovyClass.newInstance();
      script.invokeMethod("main", mainMethodArgs);
    }
    catch (Throwable e)
    {
      e.printStackTrace();
      exception = e;
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

  @SuppressWarnings("unchecked")
  protected Object getValue() {
    Object config = null;
    if (context.containsViewBean(configId)) {
      GroovyObject bean = (GroovyObject) context.getViewBean(configId);
      config = bean.invokeMethod("getComponentDefinition", null);
    } else {
      config = configService.getConfig(configId);
    }
    if (config instanceof Map) {
      return mapWrapperFactory.createWrapper(getScope(), getModelScope(), (Map<String, Object>) config);
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

  protected Object getValue() {
    Object config = null;
    Context context = Context.getCurrentContext();
    if (context.containsViewBean(extendedId)) {
      GroovyObject bean = (GroovyObject) context.getViewBean(extendedId);
      config = bean.invokeMethod("getComponentDefinition", null);
    } else {
      config = configService.getConfig(extendedId);
    }
    if (Map.class.isAssignableFrom(config.getClass())) {
      Map<String, Object> result = new LinkedHashMap<String, Object>();
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

*/
public class ConstructorTest extends TestSupport {

    public void testConstructor() throws Exception {
        GroovyObject object = compile("src/test/groovy/NewExpressionTest.groovy");
        object.invokeMethod("testNewInstance", null);
    }
}
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

*/
public class RunGroovyTest extends TestSupport {

    public void testArrayBug() throws Exception {
        GroovyObject object = compile("src/test/groovy/ToArrayBugTest.groovy");
        object.invokeMethod("testToArrayBug", null);
    }


    public void testPostfix() throws Exception {
        GroovyObject object = compile("src/test/groovy/PostfixTest.groovy");
View Full Code Here

Examples of groovy.lang.GroovyObject.invokeMethod()

    }


    public void testPostfix() throws Exception {
        GroovyObject object = compile("src/test/groovy/PostfixTest.groovy");
        object.invokeMethod("testIntegerPostfix", null);
    }

    public void testMap() throws Exception {
        GroovyObject object = compile("src/test/groovy/MapTest.groovy");
        object.invokeMethod("testMap", null);
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.