Package railo.runtime.reflection.pairs

Examples of railo.runtime.reflection.pairs.MethodParameterPair


   * @throws IllegalArgumentException
   * @throws IllegalAccessException
   * @throws InvocationTargetException
  */
  public static Object callMethod(Object object, String methodName, Object[] parameters) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException  {
      MethodParameterPair pair=
      getMethodParameterPairIgnoreCase(object.getClass(), methodName, parameters);

       
    return pair.getMethod().invoke(object,pair.getParameters());
  }
View Full Code Here


                 
                }
                //if(parameterClasses.length-1==y) return m;
              }
           
            return new MethodParameterPair(method,parameters);
            }
          }
        }
      }
     
View Full Code Here

  public static void callSetter(Object o, String prop,Object value) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
    prop="set"+StringUtil.ucFirst(prop);
    Class c=o.getClass();
    //Class[] cArg=new Class[]{value.getClass()};
    Object[] oArg=new Object[]{value};
    MethodParameterPair mp = getMethodParameterPairIgnoreCase(c, prop, oArg);
    //Method m=getMethodIgnoreCase(c,prop,cArg);
    if(!mp.getMethod().getReturnType().getName().equals("void"))
      throw new NoSuchMethodException("invalid return Type, method ["+mp.getMethod().getName()+"] must have return type void, now ["+mp.getMethod().getReturnType().getName()+"]");
    mp.getMethod().invoke(o,mp.getParameters());
  }
View Full Code Here

    if(values==null)values=new Object[0];
   
   
   
   
    MethodParameterPair mp;
    try {
      mp = getMethodParameterPairIgnoreCase(staticClass, methodName, values);
    }
    catch (NoSuchMethodException e) {
      throw Caster.toPageException(e);
    }
   
    try {
      return mp.getMethod().invoke(null,mp.getParameters());
    }
    catch (InvocationTargetException e) {
      Throwable target = e.getTargetException();
      if(target instanceof PageException) throw (PageException)target;
      throw Caster.toPageException(e.getTargetException());
View Full Code Here

TOP

Related Classes of railo.runtime.reflection.pairs.MethodParameterPair

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.