Package railo.transformer.bytecode.literal

Examples of railo.transformer.bytecode.literal.LitString


      Attribute attrPassBy = tag.getAttribute("passby");
      if(attrPassBy!=null) {
        ExprString expr = CastString.toExprString(attrPassBy.getValue());
        if(!(expr instanceof LitString))
          throw new EvaluatorException("Attribute passby of the Tag Argument, must be a literal string");
        LitString lit = (LitString)expr;
        String passBy = lit.getString().toLowerCase().trim();
        if(!"value".equals(passBy) && !"ref".equals(passBy) && !"reference".equals(passBy))
          throw new EvaluatorException("Attribute passby of the Tag Argument has an invalid value ["+passBy+"], valid values are [reference,value]");
      }
       
      // check if tag is direct inside function
View Full Code Here


        }
        else if(stat instanceof PrintOut){
          PrintOut po=(PrintOut) stat;
          Expression expr = po.getExpr();
          if(expr instanceof LitString) {
            LitString ls=(LitString) expr;
            if(StringUtil.isWhiteSpace(ls.getString())) continue;
          }
        }
       
      }
      if (stat instanceof Tag) {
View Full Code Here

      if(label!=null){
        tc.setLabel(label=label.trim());
        tag.removeAttribute("label");
      }
      else if(ASMUtil.isLiteralAttribute(tag, attrLabel, ASMUtil.TYPE_STRING, false, true)) {
        LitString ls=(LitString) CastString.toExprString(tag.getAttribute("label").getValue());
        label = ls.getString();
        if(!StringUtil.isEmpty(label,true)) {
          tc.setLabel(label=label.trim());
          tag.removeAttribute("label");
        }
        else label=null;
      }
    }
   
    if(ASMUtil.isLiteralAttribute(tag, "label", ASMUtil.TYPE_STRING, false, true)) {
      LitString ls=(LitString) CastString.toExprString(tag.getAttribute("label").getValue());
      TagContinue tc=(TagContinue) tag;
      label = ls.getString();
      if(!StringUtil.isEmpty(label,true)) {
        tc.setLabel(label=label.trim());
        tag.removeAttribute("label");
      }
      else label=null;
View Full Code Here

        tb.setLabel(label=label.trim());
        tag.removeAttribute("label");
      }
     
      else if(ASMUtil.isLiteralAttribute(tag, attrLabel, ASMUtil.TYPE_STRING, false, true)) {
        LitString ls=(LitString) CastString.toExprString(tag.getAttribute("label").getValue());
        label = ls.getString();
        if(!StringUtil.isEmpty(label,true)) {
          tb.setLabel(label=label.trim());
          tag.removeAttribute("label");
        }
        else label=null;
View Full Code Here

  public void evaluate(Tag tag,TagLibTag tagLibTag,FunctionLib[] flibs) throws EvaluatorException {
    TagWhile whil=(TagWhile) tag;
   
    // label
    if(ASMUtil.isLiteralAttribute(tag, "label", ASMUtil.TYPE_STRING, false, true)) {
      LitString ls=(LitString) CastString.toExprString(tag.getAttribute("label").getValue());
      String l = ls.getString();
      if(!StringUtil.isEmpty(l,true)) {
        whil.setLabel(l.trim());
        tag.removeAttribute("label");
      }
    }
View Full Code Here

    else if("returntype".equals(name))  {
      this.returnType=toLitString(name,attr.getValue());
    }
    else if("access".equals(name))  {
     
      LitString ls = toLitString(name,attr.getValue());
      String strAccess = ls.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());
      access=acc;
     
View Full Code Here

     * @param pos
     * @return String expression
     */
    public static ExprString toExprString(Expression expr) {
        if(expr instanceof ExprString) return (ExprString) expr;
        if(expr instanceof Literal) return new LitString(((Literal)expr).getString(),expr.getStart(),expr.getEnd());
        return new CastString(expr);
    }
View Full Code Here

  }

  public void addPrintOut(String str, Position start,Position end) {
    if(concatPrintouts(str)) return;
   
    last=new PrintOut(new LitString(str,start,end),start,end);
        last.setParent(this);
        this.statements.add(last);
  }
View Full Code Here

  private boolean concatPrintouts(String str) {
    if(last instanceof PrintOut)  {
      PrintOut po=(PrintOut) last;
      Expression expr = po.getExpr();
      if(expr instanceof LitString) {
        LitString lit=(LitString)expr;
        if(lit.getString().length()<1024) {
          po.setExpr(LitString.toExprString(lit.getString().concat(str),lit.getStart(),lit.getEnd()));
          return true;
        }
      }
    }
    return false;
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.literal.LitString

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.