@Override public Object invoke(Object object, Object[] arguments) { return cc.doConstructorInvoke(arguments); } public CachedConstructor getCachedConstrcutor() { return cc; }
public final Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); } }
public Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { MetaClassHelper.unwrap(args); try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); }
private Object invokeConstructor(Class at, Object[] arguments) { checkInitalised(); if (arguments == null) arguments = EMPTY_ARGUMENTS; Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments); MetaClassHelper.unwrap(arguments); CachedConstructor constructor = (CachedConstructor) chooseMethod("<init>", constructors, argClasses); if (constructor != null) { return constructor.doConstructorInvoke(arguments); } if (arguments.length == 1) { Object firstArgument = arguments[0]; if (firstArgument instanceof Map) { constructor = (CachedConstructor) chooseMethod("<init>", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY); if (constructor != null) { Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY); setProperties(bean, ((Map) firstArgument)); return bean; } } } throw new GroovyRuntimeException( "Could not find matching constructor for: " + theClass.getName() + "(" + InvokerHelper.toTypeString(arguments) + ")"); }
public final Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); } }
public final Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); } }
public final Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); } }
public Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { MetaClassHelper.unwrap(args); try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); }
public Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { MetaClassHelper.unwrap(args); try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); }
public Object callConstructor(Object receiver, Object[] args) throws Throwable { if (checkCall(receiver, args)) { MetaClassHelper.unwrap(args); try { return constructor.doConstructorInvoke(args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre); } } else return CallSiteArray.defaultCallConstructor(this, receiver, args); }
private Object invokeConstructor(Class at, Object[] arguments) { checkInitalised(); if (arguments == null) arguments = EMPTY_ARGUMENTS; Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments); MetaClassHelper.unwrap(arguments); CachedConstructor constructor = (CachedConstructor) chooseMethod("<init>", constructors, argClasses); if (constructor != null) { return constructor.doConstructorInvoke(arguments); } if (arguments.length == 1) { Object firstArgument = arguments[0]; if (firstArgument instanceof Map) { constructor = (CachedConstructor) chooseMethod("<init>", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY); if (constructor != null) { Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY); setProperties(bean, ((Map) firstArgument)); return bean; } } } throw new GroovyRuntimeException( "Could not find matching constructor for: " + theClass.getName() + "(" + InvokerHelper.toTypeString(arguments) + ")"); }
private Object invokeConstructor(Class at, Object[] arguments) { checkInitalised(); if (arguments == null) arguments = EMPTY_ARGUMENTS; Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments); MetaClassHelper.unwrap(arguments); CachedConstructor constructor = (CachedConstructor) chooseMethod("<init>", constructors, argClasses); if (constructor != null) { return constructor.doConstructorInvoke(arguments); } if (arguments.length == 1) { Object firstArgument = arguments[0]; if (firstArgument instanceof Map) { constructor = (CachedConstructor) chooseMethod("<init>", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY); if (constructor != null) { Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY); setProperties(bean, ((Map) firstArgument)); return bean; } } } throw new GroovyRuntimeException( "Could not find matching constructor for: " + theClass.getName() + "(" + InvokerHelper.toTypeString(arguments) + ")"); }
private Object invokeConstructor(Class at, Object[] arguments) { checkInitalised(); if (arguments == null) arguments = EMPTY_ARGUMENTS; Class[] argClasses = MetaClassHelper.convertToTypeArray(arguments); MetaClassHelper.unwrap(arguments); CachedConstructor constructor = (CachedConstructor) chooseMethod("<init>", constructors, argClasses); if (constructor != null) { return constructor.doConstructorInvoke(arguments); } if (arguments.length == 1) { Object firstArgument = arguments[0]; if (firstArgument instanceof Map) { constructor = (CachedConstructor) chooseMethod("<init>", constructors, MetaClassHelper.EMPTY_TYPE_ARRAY); if (constructor != null) { Object bean = constructor.doConstructorInvoke(MetaClassHelper.EMPTY_ARRAY); setProperties(bean, ((Map) firstArgument)); return bean; } } } throw new GroovyRuntimeException( "Could not find matching constructor for: " + theClass.getName() + "(" + InvokerHelper.toTypeString(arguments) + ")"); }