/** * Access to invoke a method on the class that this fast class handles * * @param name The name of the method to invoke, * @param parameterTypes The method parameter types * @param obj The instance on which to invoke the method * @param args The parameter arguments * * @return The method result * * @throws InvocationTargetException Indicates a problem performing invocation */ public Object invoke( String name, Class[] parameterTypes, Object obj, Object[] args) throws InvocationTargetException { return this.invoke( this.getIndex( name, parameterTypes ), obj, args ); }
public Object invoke( int index, Object obj, Object[] args) throws InvocationTargetException { Method[] methods = this.type.getMethods(); try { return methods[index].invoke( obj, args ); } catch ( ArrayIndexOutOfBoundsException e ) { throw new IllegalArgumentException( "Cannot find matching method/constructor" ); } catch ( IllegalAccessException e ) { throw new InvocationTargetException( e ); } }
public Object invoke( int index, Object obj, Object[] args) throws InvocationTargetException { Method[] methods = this.type.getMethods(); try { return methods[index].invoke( obj, args ); } catch ( ArrayIndexOutOfBoundsException e ) { throw new IllegalArgumentException( "Cannot find matching method/constructor" ); } catch ( IllegalAccessException e ) { throw new InvocationTargetException( e ); } }
/** * Access to invoke a method on the class that this fast class handles * * @param name The name of the method to invoke, * @param parameterTypes The method parameter types * @param obj The instance on which to invoke the method * @param args The parameter arguments * * @return The method result * * @throws InvocationTargetException Indicates a problem performing invocation */ public Object invoke( String name, Class[] parameterTypes, Object obj, Object[] args) throws InvocationTargetException { return this.invoke( this.getIndex( name, parameterTypes ), obj, args ); }