Package groovy.lang

Examples of groovy.lang.MissingMethodException


                        closure = (Closure) object2;
                        node = proxyBuilder.createNode(name, object1);
                    } else if (object2 instanceof Map) {
                        node = proxyBuilder.createNode(name, (Map) object2, object1);
                    } else {
                        throw new MissingMethodException(name.toString(), getClass(), list.toArray(), false);
                    }
                }
            }
            break;
            case 3: {
                Object arg0 = list.get(0);
                Object arg1 = list.get(1);
                Object arg2 = list.get(2);
                if (arg0 instanceof Map && arg2 instanceof Closure) {
                    closure = (Closure) arg2;
                    node = proxyBuilder.createNode(name, (Map) arg0, arg1);
                } else if (arg1 instanceof Map && arg2 instanceof Closure) {
                    closure = (Closure) arg2;
                    node = proxyBuilder.createNode(name, (Map) arg1, arg0);
                } else {
                    throw new MissingMethodException(name.toString(), getClass(), list.toArray(), false);
                }
            }
            break;
            default: {
                throw new MissingMethodException(name.toString(), getClass(), list.toArray(), false);
            }

        }

        if (current != null) {
View Full Code Here


    public Object methodMissing(String name, Object arg) {
        Object[] args = (Object[]) arg;
        Configuration configuration = configurationContainer.findByName(name);
        if (configuration == null) {
            throw new MissingMethodException(name, this.getClass(), args);
        }
        List<Object> normalizedArgs = GUtil.flatten(Arrays.asList(args), false);
        if (normalizedArgs.size() == 2 && normalizedArgs.get(1) instanceof Closure) {
            return pushArtifact(configuration, normalizedArgs.get(0), (Closure) normalizedArgs.get(1));
        }
View Full Code Here

        Object[] params = (Object[])paramsObj;

        boolean isAlreadyConfiguring = _configuring.get();
        _configuring.set(true);
        try {
            MissingMethodException failure;
            try {
                return _delegate.invokeMethod(name, params);
            } catch (groovy.lang.MissingMethodException e) {
                // TODO - should check the type as well, and below too, however we have no idea what the final type is going to be.
                // Rework the DynamicObject contract to allow us to know if the method was found or not
View Full Code Here

    public Object methodMissing(String name, Object args) {
        Object[] argsArray = (Object[]) args;
        Configuration configuration = configurationContainer.findByName(name);
        if (configuration == null) {
            throw new MissingMethodException(name, this.getClass(), argsArray);
        }

        List<?> normalizedArgs = CollectionUtils.flattenCollections(argsArray);
        if (normalizedArgs.size() == 2 && normalizedArgs.get(1) instanceof Closure) {
            return doAdd(configuration, normalizedArgs.get(0), (Closure) normalizedArgs.get(1));
View Full Code Here

                BeanDynamicObject dynamicObject = new BeanDynamicObject(object);
                if (dynamicObject.hasMethod(name, args)) {
                    return dynamicObject.invokeMethod(name, args);
                }
            }
            throw new MissingMethodException(name, Convention.class, args);
        }
View Full Code Here

        if (!executingDsl.get()) {
            if (name.equals("$")) {
                throw new GradleException(ATTEMPTED_INPUT_SYNTAX_USED_MESSAGE);
            } else {
                throw new MissingMethodException(name, getClass(), args);
            }
        } else {
            if (args.length != 1 || !(args[0] instanceof Closure)) {
                throw new MissingMethodException(name, getClass(), args);
            } else {
                Closure closure = (Closure) args[0];
                getChildPath(name).registerConfigurationAction(closure);
                return null;
            }
View Full Code Here

  private Object _gdk(String name, Object[] args) {
    PipeLineClosure find = _sub(name);
    if (find != null) {
      return find.call(args);
    } else {
      throw new MissingMethodException(name, PipeLineClosure.class, args);
    }
  }
View Full Code Here

   */
  public Object methodMissing(String name, Object arg) {
        Object[] args = (Object[])arg;

        if(args.length == 0)
      throw new MissingMethodException(name,getClass(),args);

    if(args[0] instanceof Closure) {
            // abstract bean definition
            return invokeBeanDefiningMethod(name, args);
    }
View Full Code Here

    if (isMethod(method, "setProperty", String.class, Object.class)) {
      String methodName = GroovyRuntimeUtil.propertyToMethodName("set", (String) normalizedArgs[0]);
      return GroovyRuntimeUtil.invokeMethod(target, methodName, normalizedArgs[1]);
    }
    if (isMethod(method, "methodMissing", String.class, Object.class)) {
      throw new MissingMethodException((String) normalizedArgs[0],
          mockConfiguration.getType(), new Object[] {normalizedArgs[1]}, false);
    }
    if (isMethod(method, "propertyMissing", String.class)) {
      throw new MissingPropertyException((String) normalizedArgs[0], mockConfiguration.getType());
    }
View Full Code Here

                    } else {
                        buff.append("<unknown>");
                    }
                    abortThrowable = t;
                    if(t instanceof MissingMethodException) {
                        MissingMethodException e = (MissingMethodException)t;
                         System.out.println("===> "+sElem.getName()+", MISSING:"+e.getMethod());
                    }
                    logger.error("Failed to load the ServiceBean [{}] {} [{}]", sElem.getName(), label, buff.toString(),
                                 abortThrowable);
                    container.discarded(identifier);
                    terminate();
View Full Code Here

TOP

Related Classes of groovy.lang.MissingMethodException

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.