Package railo.runtime.exp

Examples of railo.runtime.exp.FunctionException


 
  public static Object call(PageContext pc, String key, Object objThrowWhenNotExist,String cacheName) throws PageException {
   
   
    Boolean throwWhenNotExist=Caster.toBoolean(objThrowWhenNotExist,null);
    if(throwWhenNotExist==null)throw new FunctionException(pc, "cacheGet", 2, "ThrowWhenNotExist", "arguments needs to be a boolean value");
   
    try {
      Cache cache = Util.getCache(pc,cacheName,ConfigImpl.CACHE_DEFAULT_OBJECT);
      return _call(pc, key, throwWhenNotExist.booleanValue(), cache);
    } catch (IOException e) {
View Full Code Here


  private static final long serialVersionUID = 7155984396258463949L;

  public static Object call(PageContext pc, Object webservice) throws PageException {
    if(!(webservice instanceof RPCClient))
      throw new FunctionException(pc, "getSOAPResponse", 1, "webservice", "value must be a webservice Object generated with createObject/<cfobject>");
    try {
      return AxisUtil.getSOAPResponse((RPCClient) webservice);
    }
    catch (Exception e) {
      throw Caster.toPageException(e);
View Full Code Here

      StringBuilder sb = new StringBuilder();
      int len=list.length();
      int index=0;
      char last=0,c;
     
      if(pos<1) throw new FunctionException(pc,"ListDeleteAt",2,"index","index must be greater than 0");
     
      pos--;
     
      int i=0;
     
      // ignore all delimiter at start
      if(!includeEmptyFields)for(;i<len;i++){
        c=list.charAt(i);
        if(!equal(del,c)) break;
        sb.append(c);
      }
     
      // before
      for(;i<len;i++){
       
        c=list.charAt(i);
        if(index==pos && !equal(del,c)) break;
        if(equal(del,c)) {
          if(includeEmptyFields || !equal(del,last))
            index++;
        }
        sb.append(c);
        last=c;
      }
     
     
      // suppress item
      for(;i<len;i++){
        if(equal(del,list.charAt(i))) break;
      }
     
      // ignore following delimiter
      for(;i<len;i++){
        if(!equal(del,list.charAt(i))) break;
      }
     
      if(i==len){
       
        while(sb.length()>0 && equal(del,sb.charAt(sb.length()-1))) {
          sb.delete(sb.length()-1, sb.length());
        }
        if(pos>index) throw new FunctionException(pc,"ListDeleteAt",2,"index","index must be a integer between 1 and "+index);
         
        return sb.toString();
      }
     
     
View Full Code Here

  public static Object call(PageContext pc, Object webservice,String namespace, String name) throws PageException {
    return call(pc,webservice,namespace,name,false);
  }
  public static Object call(PageContext pc, Object webservice, String namespace, String name, boolean asXML) throws PageException {
    if(!(webservice instanceof RPCClient))
      throw new FunctionException(pc, "getSOAPResponse", 1, "webservice", "value must be a webservice Object generated with createObject/<cfobject>");
    try {
      return AxisUtil.getSOAPResponseHeader(pc, (RPCClient) webservice, namespace, name, asXML);
    } catch (Exception e) {
      throw Caster.toPageException(e);
    }
View Full Code Here

  public static double call(PageContext pc , double dnumber, double dstart, double dlength) throws FunctionException {

    int number=(int) dnumber,start=(int) dstart,length=(int) dlength;
   
    if(start > 31 || start < 0)
      throw new FunctionException(pc,"bitMaskRead",2,"start","must be beetween 0 and 31 now "+start);
    if(length > 31 || length < 0)
      throw new FunctionException(pc,"bitMaskRead",3,"length","must be beetween 0 and 31 now "+length);
   

        return number >> start & (1 << length) - 1;
  }
View Full Code Here

public final class BitSHRN implements Function {
 
  public static double call(PageContext pc , double dnumber, double dcount) throws FunctionException {
    int number=(int) dnumber,count=(int) dcount;
    if(count > 31 || count < 0)
      throw new FunctionException(pc,"bitSHRN",2,"count","must be beetween 0 and 31 now "+count);
   
    return number >>> count;
 
View Full Code Here

        for(int i=1;i<=len;i++) {
            arr[0]=array.get(i,null);
            if(arr[0]!=null) {
              res=udf.call(pc, arr, false);
              b=Caster.toBoolean(res,null);
              if(b==null) throw new FunctionException(pc,"ArrayFind",2,"function","return value of the "+(udf instanceof Closure?"closure":"function ["+udf.getFunctionName()+"]")+" cannot be casted to a boolean value.",CasterException.createMessage(res, "boolean"));
              if(b.booleanValue())return i;
            }
        }
        return 0;
    }
View Full Code Here

public final class BitSHLN implements Function {
  public static double call(PageContext pc , double dnumber, double dcount) throws FunctionException {
    int number=(int) dnumber,count=(int) dcount;
    if(count > 31 || count < 0)
      throw new FunctionException(pc,"bitSHLN",2,"count","must be beetween 0 and 31 now "+count);
   
    return number << count;
 
View Full Code Here

 
  public static Array call(PageContext pc , Array arr, double start, double count) throws ExpressionException {
    int s=(int) start;
    int c=(int) count;
   
    if(s<1) throw new FunctionException(pc, "ArrayMid", 2, "start", "Parameter which is now ["+s+"] must be a positive integer");
    if(c==-1) c=arr.size();
    else if(c<-1) throw new FunctionException(pc, "ArrayMid", 3, "count", "Parameter which is now ["+c+"] must be a non-negative integer or -1 (for string length)");
    c+=s-1;
    if(s>arr.size()) return new ArrayImpl();
   
    ArrayImpl rtn = new ArrayImpl();
    int len = arr.size();
View Full Code Here

import railo.runtime.op.Caster;

public final class Log implements Function {
  public static double call(PageContext pc , double number) throws ExpressionException {
    if(number<=0.0D)
      throw new FunctionException(pc,"log",1,"number","value must be a positive number now "+Caster.toString(number)+"");
    return StrictMath.log(number);
  }
View Full Code Here

TOP

Related Classes of railo.runtime.exp.FunctionException

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.