Package railo.transformer.bytecode

Examples of railo.transformer.bytecode.BytecodeException


    if(expr instanceof ExprString) return (ExprString) expr;
    return LitString.toExprString(translateVariableToString(expr,rawIfPossible), expr.getStart(),expr.getEnd());
  }
 
  private static String translateVariableToString(Expression expr, boolean rawIfPossible) throws BytecodeException {
    if(!(expr instanceof Variable)) throw new BytecodeException("can't translate value to a string",expr.getStart());
    return variableToString((Variable) expr,rawIfPossible);
  }
View Full Code Here


    Iterator it = members.iterator();
    DataMember dm;
    Expression n;
    while(it.hasNext()) {
      Object o = it.next();
      if(!(o instanceof DataMember)) throw new BytecodeException("can't translate Variable to a String",var.getStart());
      dm=(DataMember) o;
      n=dm.getName();
      if(n instanceof Literal) {
        if(rawIfPossible && n instanceof Identifier) {
          arr.add(((Identifier) n).getRaw());
        }
        else {
          arr.add(((Literal) n).getString());
        }
      }
      else throw new BytecodeException("argument name must be a constant value",var.getStart());
    }
    return arr.toArray(new String[arr.size()]);
  }
View Full Code Here

          else vt.value.writeOut(bc, Types.isPrimitiveType(argTypes[index])?MODE_VALUE:MODE_REF);
        }
       
        for(int y=0;y<names.length;y++){
          if(names[y]!=null) {
            BytecodeException bce = new BytecodeException("argument ["+names[y]+"] is not allowed for function ["+bif.getFlf().getName()+"]", args[y].getStart());
            UDFUtil.addFunctionDoc(bce, bif.getFlf());
            throw bce;
          }
        }
       
View Full Code Here

   
    // if not required return the default value
    if(!flfa.getRequired()) {
      return getDefaultValue(flfa);
    }
    BytecodeException be = new BytecodeException("missing required argument ["+flfan+"] for function ["+flfa.getFunction().getName()+"]",line);
    UDFUtil.addFunctionDoc(be, flfa.getFunction());
    throw be;
  }
View Full Code Here

    return new VT(CastOther.toExpression(LitString.toExprString(defaultValue), type),type,-1);
  }

  private static String getName(Expression expr) throws BytecodeException {
    String name = ASMUtil.toString(expr);
    if(name==null) throw new BytecodeException("cannot extract a string from a object of type ["+expr.getClass().getName()+"]",null);
    return name;
  }
View Full Code Here

    if(ArrayUtil.isEmpty(args)) return false;
    boolean named=false;
    for(int i=0;i<args.length;i++){
      if(args[i] instanceof NamedArgument)named=true;
      else if(named)
        throw new BytecodeException("invalid argument for function "+funcName+", you can not mix named and unnamed arguments", args[i].getStart());
    }
   
   
    return named;
  }
View Full Code Here

        // TODO Array als Lbyte und auch byte[]
       
    try {
      return Type.getType(ClassUtil.loadClass(type));
    } catch (ClassException e) {
      throw new BytecodeException(e,null);
    }
  }
View Full Code Here

    // type
    if(type==null || type instanceof ExprString) ;
    else if(type instanceof Variable) {
      type=VariableString.toExprString(type);
    }
    else throw new BytecodeException("type from catch statement is invalid",type.getStart());
   
    // name
    if(name instanceof LitString){
      Variable v = new Variable(Scope.SCOPE_UNDEFINED,name.getStart(),name.getEnd());
      v.addMember(new DataMember(name));
      name=new VariableRef(v);
    }
    else if(name instanceof Variable) name=new VariableRef((Variable) name);
    else throw new BytecodeException("name from catch statement is invalid",name.getStart());
   
    addCatch((ExprString)type, (VariableRef)name, b, line);
 
View Full Code Here

    break;
   
   
   
    default:
      throw new BytecodeException("invalid type",getStart());
    }
  }
View Full Code Here

    }
   
    String strAccess = ((LitString)access).getString();
    int acc = ComponentUtil.toIntAccess(strAccess,-1);
    if(acc==-1)
      throw new BytecodeException("invalid access type ["+strAccess+"], access types are remote, public, package, private",getStart());
       
    Function func = new FunctionImpl(page,name, returnType,returnFormat, output, bufferOutput, acc, displayname,description,
        hint,secureJson,verifyClient,localMode,cachedWithin,_abstract,_final, body, getStart(),getEnd());
    
   
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.BytecodeException

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.