Package railo.runtime.reflection.pairs

Examples of railo.runtime.reflection.pairs.MethodInstance.invoke()


  @Override
  public Object call(PageContext pc, Key methodName, Object[] arguments) throws PageException {
    MethodInstance mi = Reflector.getMethodInstanceEL(this,this.getClass(), methodName, arguments);
    if(mi!=null) {
      try {
        return mi.invoke(this);
      } catch (Throwable t) {
        try {
          return pc.getFunction(QueryUtil.getValue(this,query.getCurrentrow(pc.getId())), methodName, arguments);
        } catch (PageException pe) {
          throw Caster.toPageException(t);
View Full Code Here


       
    MethodInstance mi=getMethodInstanceEL(obj,obj.getClass(), methodName, args);
    if(mi==null)
        throw throwCall(obj,methodName,args);
      try {
        return mi.invoke(obj);
        }
    catch (InvocationTargetException e) {
      Throwable target = e.getTargetException();
      if(target instanceof PageException) throw (PageException)target;
      throw new NativeException(e.getTargetException());
View Full Code Here

       
    MethodInstance mi=getMethodInstanceEL(obj,obj.getClass(), methodName, args);
    if(mi==null)
        return defaultValue;
      try {
        return mi.invoke(obj);
        }
    catch (Throwable t) {
      return defaultValue;
    }
  }
View Full Code Here

   * @throws PageException
   */
  public static void callSetterEL(Object obj, String prop,Object value) throws PageException {
      try {
        MethodInstance setter = getSetter(obj, prop, value,null);
        if(setter!=null)setter.invoke(obj);
    }
    catch (InvocationTargetException e) {
      Throwable target = e.getTargetException();
      if(target instanceof PageException) throw (PageException)target;
      throw Caster.toPageException(e.getTargetException());
View Full Code Here

      while(it.hasNext()) {
        e = it.next();
        setter = Reflector.getSetter(tag, e.getKey().getString(),e.getValue(),null);
        if(setter!=null) {
          try {
            setter.invoke(tag);
          }
          catch (Exception _e) {
            throw Caster.toPageException(_e);
          }
        }
View Full Code Here

        // Getter
            MethodInstance mi = Reflector.getGetterEL(clazz,propertyName);
            if(mi!=null) {
                if(Modifier.isStatic(mi.getMethod().getModifiers())) {
                    try {
                        return mi.invoke(null);
                    }
                    catch (IllegalAccessException e) {
                        throw Caster.toPageException(e);
                    }
                    catch (InvocationTargetException e) {
View Full Code Here

        // Getter
        MethodInstance mi = Reflector.getGetterEL(clazz,propertyName);
        if(mi!=null) {
            if(Modifier.isStatic(mi.getMethod().getModifiers())) {
                try {
                    return mi.invoke(null);
                }
                catch (Exception e) {}   
            }
        }
        try {
View Full Code Here

        // Getter
        MethodInstance mi = Reflector.getSetter(clazz,propertyName.getString(),value,null);
        if(mi!=null) {
            if(Modifier.isStatic(mi.getMethod().getModifiers())) {
                try {
                    return mi.invoke(null);
                }
                catch (IllegalAccessException e) {
                    throw Caster.toPageException(e);
                }
                catch (InvocationTargetException e) {
View Full Code Here

        // Getter
        MethodInstance mi = Reflector.getSetter(clazz,propertyName.getString(),value,null);
        if(mi!=null) {
            if(Modifier.isStatic(mi.getMethod().getModifiers())) {
                try {
                    return mi.invoke(null);
                }
                catch (Exception e) {}   
            }
        }
          
View Full Code Here

      try {
        // get method
        MethodInstance mi = Reflector.getMethodInstance(this,clazz,methodName,arguments);
      // call static method if exist
        if(Modifier.isStatic(mi.getMethod().getModifiers())) {
        return mi.invoke(null);
      }
       
        if(arguments.length==0 && methodName.equalsIgnoreCase("getClass")){
          return clazz;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.