Package groovy.lang

Examples of groovy.lang.MissingMethodException


            BeanDynamicObject dynamicObject = new BeanDynamicObject(object);
            if (dynamicObject.hasMethod(name, arguments)) {
                return dynamicObject.invokeMethod(name, arguments);
            }
        }
        throw new MissingMethodException(name, Convention.class, arguments);
    }
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

        final Object value = ctx.getAttribute(name);
        if (value instanceof Closure) {
            return ((Closure) value).call(args);
        } else {
            throw new MissingMethodException(name, getClass(), args);
        }
    }
View Full Code Here

        }
       
        break;
       
      default:
        throw new MissingMethodException(name, builder.getClass(), args);
    }
   
    return this.handleNode(builder, stack, name, builder.startNode(name, value, parameters), parameters, closure);
  }
View Full Code Here

    // to call the method on the builder
    if (method != null && callProxyFirst) return method.invoke(builder, args);
   
    // If we get here we have attempted all methods for valid invocation
    // thus we must throw a MME
    throw new MissingMethodException(name, builder.getClass(), args);
   
  }
View Full Code Here

            Object value = ctx.getAttribute(name);
            if (value instanceof Closure) {
                return ((Closure) value).call(args);
            } // else fall thru..
        }
        throw new MissingMethodException(name, getClass(), args);
    }
View Full Code Here

    public Object invoke(CachedMethod method, Object object, Object[] arguments) {
        return noSuchMethod(method, object, arguments);
    }

    protected Object noSuchMethod(CachedMethod method, Object object, Object[] arguments) {
        throw new MissingMethodException(method.getName(), method.getDeclaringClass().getTheClass(), arguments, false);
    }
View Full Code Here

            Object value = ctx.getAttribute(name);
            if (value instanceof Closure) {
                return ((Closure) value).call(args);
            } // else fall thru..
        }
        throw new MissingMethodException(name, getClass(), args);
    }
View Full Code Here

                        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

                            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

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.