Package railo.runtime.exp

Examples of railo.runtime.exp.FunctionException


    if(Decision.isArray(data))
      return _populate(pc,qry,Caster.toArray(data));
    else if(Decision.isStruct(data))
      return _populate(pc,qry,Caster.toStruct(data));
    else
      throw new FunctionException(pc, "QueryNew", 3, "data", "the date must be defined as array of structs , array of arrays or struct of arrays");
  }
View Full Code Here


  }
  public static Query call(PageContext pc , Query qry,double offset,double length) throws PageException {
     
    int len=qry.getRecordcount();
    if(offset>0) {
      if(len<offset)throw new FunctionException(pc,"querySlice",2,"offset","offset can be greater than recordcount of the query");
     
      int to=0;
      if(length>0)to=(int)(offset+length-1);
      else if(length<=0)to=(int)(len+length);
      if(len<to)
        throw new FunctionException(pc,"querySlice",3,"length","offset+length can be greater than recordcount of the query");
     
      return get(qry,(int)offset,to);
    }
    return call(pc ,qry,len+offset,length);
  }
View Full Code Here

        return new ExpressionException(message, detail);
    }
   
    @Override
    public PageException createFunctionException(PageContext pc,String functionName, String badArgumentPosition, String badArgumentName, String message) {
        return new FunctionException(pc,functionName, badArgumentPosition, badArgumentName,message,null);
    }
View Full Code Here

        return new FunctionException(pc,functionName, badArgumentPosition, badArgumentName,message,null);
    }
   
    @Override
    public PageException createFunctionException(PageContext pc,String functionName, int badArgumentPosition, String badArgumentName, String message, String detail) {
        return new FunctionException(pc,functionName, badArgumentPosition, badArgumentName,message,detail);
    }
View Full Code Here

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

    int number=(int)dnumber, mask=(int)dmask, start=(int)dstart, length=(int)dlength;
   
    if(start > 31 || start < 0)
      throw new FunctionException(pc,"bitMaskSet",2,"start","must be beetween 0 and 31 now "+start);
    if(length > 31 || length < 0)
      throw new FunctionException(pc,"bitMaskSet",3,"length","must be beetween 0 and 31 now "+length);
   
        int tmp = (1 << length) - 1 << start;
        mask &= (1 << length) - 1;
        return number & ~tmp | mask << start;
  }
View Full Code Here

* Implements the CFML Function inputbasen
*/
public final class InputBaseN implements Function {
  public static double call(PageContext pc , String string, double radix) throws ExpressionException {
    if(radix<2 || radix>36)
      throw new FunctionException(pc,"inputBaseN",2,"radix","radix must be between 2 an 36");
   
    string=string.trim().toLowerCase();
    if(string.startsWith("0x")) string=string.substring(2, string.length());
   
    if(string.length()>32)
      throw new FunctionException(pc,"inputBaseN",1,"string","argument is to large can be a maximum of 32 digits (-0x at start)");
   
        //print.ln(string+"-"+radix);
    return (int)Long.parseLong(string, (int)radix);
   
       
View Full Code Here

    else sheetName=Caster.toString(oSheetName);
   
    // format
    short format=toFormat(oXmlFormat);
    if(format==Excel.FORMAT_UNDEFINED)
      throw new FunctionException(pc, "SpreadSheetNew", 2, "xmlFormat", "invalid value ["+oXmlFormat+"], valid values are [true,false,XSSF,HSSF]");
   
    return new Excel(sheetName, format, 0);
  }
View Full Code Here

            if(mask==null)
              return new railo.runtime.util.NumberFormat().format(locale,NumberFormat.toNumber(pc,object));
      return new railo.runtime.util.NumberFormat().format(locale,NumberFormat.toNumber(pc,object),mask);
        }
        catch (InvalidMaskException e) {
            throw new FunctionException(pc,"lsnumberFormat",1,"number",e.getMessage());
        }
  }
View Full Code Here

  }
  public static Array call(PageContext pc , Array arr,double offset,double length) throws PageException {
       
    int len=arr.size();
    if(offset>0) {
      if(len<offset)throw new FunctionException(pc,"arraySlice",2,"offset","Offset cannot be greater than size of the array");
     
      int to=0;
      if(length>0)to=(int)(offset+length-1);
      else if(length<0)to=(int)(len+length);
      if(len<to)
        throw new FunctionException(pc,"arraySlice",3,"length","Offset+length cannot be greater than size of the array");
     
      return get(arr,(int)offset,to);
    }
    return call(pc ,arr,len+offset,length);
  }
View Full Code Here

import railo.runtime.ext.function.Function;

public final class FormatBaseN implements Function {
  public static String call(PageContext pc , double number, double radix) throws ExpressionException {
    if(radix<2 || radix>36)
      throw new FunctionException(pc,"formatBaseN",2,"radix","radix must be between 2 an 36");
    return Long.toString((int)number & 0xffffffffL,(int)radix);
  }
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.