Package railo.runtime.exp

Examples of railo.runtime.exp.TemplateException


  private OutputStream getOutputStream() throws PageException, IOException {
        try {
          return ((PageContextImpl)pageContext).getResponseStream();
        }
        catch(IllegalStateException ise) {
            throw new TemplateException("content is already send to user, flush");
        }
    }
View Full Code Here


    if(eval!=null) return eval;
    try {
      eval = (FunctionEvaluator) ClassUtil.loadInstance(tteClass);
    }
    catch (ClassException e) {
      throw new TemplateException(e.getMessage());
    }
    return eval;
  }
View Full Code Here

    public TagLib execute(Config config, Tag tag, TagLibTag libTag, FunctionLib[] flibs, Data data) throws TemplateException {
     
      // encoding
      String encoding=ASMUtil.getAttributeString(tag, "charset",null);
        if(encoding==null)
          throw new TemplateException(data.cfml,"attribute [pageencoding] of the tag [processingdirective] must be a constant value");
       
        if(encoding.equalsIgnoreCase(data.cfml.getCharset()) || "UTF-8".equalsIgnoreCase(data.cfml.getCharset())) {
          encoding=null;
        }
       
View Full Code Here

          tag.removeAttribute("label");
        }
      }
    }
    catch (EvaluatorException e) {
      throw new TemplateException(null, e);
    }
      return null;
  }
View Full Code Here

      // dot notation
      Boolean dotNotationUpperCase = null;
      if(tag.containsAttribute("preservecase")) {
        Boolean preservecase = ASMUtil.getAttributeBoolean(tag, "preservecase",null);
            if(preservecase==null)
              throw new TemplateException(data.cfml,"attribute [preserveCase] of the tag [processingdirective] must be a constant boolean value");
            dotNotationUpperCase=preservecase.booleanValue()?Boolean.FALSE:Boolean.TRUE;
           
            if(dotNotationUpperCase==data.settings.dotNotationUpper)
              dotNotationUpperCase=null;
           
      }

      // page encoding
      String encoding=null;
      if(tag.containsAttribute("pageencoding")) {
            encoding=ASMUtil.getAttributeString(tag, "pageencoding",null);
            if(encoding==null)
              throw new TemplateException(data.cfml,"attribute [pageencoding] of the tag [processingdirective] must be a constant value");
           
            if(encoding.equalsIgnoreCase(data.cfml.getCharset()) || "UTF-8".equalsIgnoreCase(data.cfml.getCharset())) {
            encoding=null;
          }
        }

      // execution log
      Boolean exeLog=null;
      if(tag.containsAttribute("executionlog")) {
        String strExeLog=ASMUtil.getAttributeString(tag, "executionlog",null);
            exeLog=Caster.toBoolean(strExeLog,null);
            if(exeLog==null)
              throw new TemplateException(data.cfml,"attribute [executionlog] of the tag [processingdirective] must be a constant boolean value");
            if(exeLog.booleanValue()==data.cfml.getWriteLog())
              exeLog=null;
        }
     
     
View Full Code Here

        Assign a=(Assign) expr;
        return new NamedArgument(a.getVariable(),a.getValue(),type,varKeyUpperCase);
      }
    }
    catch(BytecodeException be) {
      throw new TemplateException(data.cfml,be.getMessage());
    }
    return new Argument(expr,type);
  }
View Full Code Here

          expr=new Assign((Variable)expr,assignOp(data));
        else if(expr instanceof Null) {
          expr=new Assign(((Null)expr).toVariable(),assignOp(data));
        }
        else
          throw new TemplateException(data.cfml,"invalid assignment left-hand side ("+expr.getClass().getName()+")");
      }
    }
    return expr;
  }
View Full Code Here

          if(data.cfml.forwardIfCurrent(':')) {
            comments(data);
              Expression right = assignOp(data);
           
            if(!(expr instanceof Variable) )
              throw new TemplateException(data.cfml,"left operant of the Elvis operator has to be a variable or a function call");
           
            return OpElvis.toExpr((Variable)expr, right);
          }
         
          Expression left = assignOp(data);
          comments(data);
          if(!data.cfml.forwardIfCurrent(':'))throw new TemplateException("invalid conditional operator");
          comments(data);
          Expression right = assignOp(data);
         
            expr=OpContional.toExpr(expr, left, right);
    }
View Full Code Here

      if((expr=json(data,JSON_STRUCT,'{','}'))!=null) {
        data.mode=DYNAMIC;
        return expr;
      }
    // else Error
      throw new TemplateException(data.cfml,"Syntax Error, Invalid Construct")
  }
View Full Code Here

          data.cfml.next();
                    comments(data);
          Expression inner=assignOp(data);
                    comments(data);
          if (!data.cfml.isCurrent('#'))
            throw new TemplateException(data.cfml,"Invalid Syntax Closing [#] not found");
         
          ExprString exprStr=null;
          if(str.length()!=0) {
            exprStr=new LitString(str.toString(),line,data.cfml.getPosition());
            if(expr!=null){
              expr = OpString.toExprString(expr, exprStr);
            }
            else expr=exprStr;
            str=new StringBuffer();
          }
          if(expr==null) {
            expr=inner;
          }
          else  {
            expr = OpString.toExprString(expr, inner);
         
        }
      }
      // check quoter
      else if(data.cfml.isCurrent(quoter)) {
        // Ecaped sharp
        if(data.cfml.isNext(quoter)){
          data.cfml.next();
          str.append(quoter);
        }
        // finsish
        else {
          break;
        }       
      }
      // all other character
      else {
        str.append(data.cfml.getCurrent());
      }
    }
    if(!data.cfml.forwardIfCurrent(quoter))
      throw new TemplateException(data.cfml,"Invalid Syntax Closing ["+quoter+"] not found");
   
    if(expr==null)
      expr=new LitString(str.toString(),line,data.cfml.getPosition());
    else if(str.length()!=0) {
      expr = OpString.toExprString(expr, new LitString(str.toString(),line,data.cfml.getPosition()));
View Full Code Here

TOP

Related Classes of railo.runtime.exp.TemplateException

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.