Package railo.transformer.cfml.evaluator

Examples of railo.transformer.cfml.evaluator.EvaluatorException


    String ns=libTag.getTagLib().getNameSpaceAndSeparator();
      String ifName=ns+"if";
 
    // check if tag is direct inside if
    if(!ASMUtil.isParentTag(tag, TagIf.class)) {
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be direct inside a "+ifName+" tag");
    }
     
    // check if is there a elseif tag after this tag
    if(ASMUtil.hasSisterTagAfter(tag,"elseif"))
      throw new EvaluatorException("Wrong Context, tag cfelseif can't be after tag else");
    // check if tag else is unique
    if(ASMUtil.hasSisterTagWithSameName(tag))
     throw new EvaluatorException("Wrong Context, tag else must be once inside the tag if");
   
  }
View Full Code Here


       
        // replace script with component 
        ASMUtil.replace(p, tag, false);
      }
      else
        throw new EvaluatorException("Wrong Context, tag "+tlt.getFullName()+" can't be inside other tags, tag is inside tag "+p.getFullname());
    }

    Page page=(Page) pPage;
   
    // is inside a file named cfc
    String src=page.getSource();
    int pos=src.lastIndexOf(".");
    if(!(pos!=-1 && pos<src.length() && src.substring(pos+1).equals("cfc")))
      throw new EvaluatorException("Wrong Context, "+tlt.getFullName()+" tag must be inside a file with extension cfc");
   
    // check if more than one component in document and remove any other data
    List stats = page.getStatements();
    Iterator it = stats.iterator();
    Statement stat;
    int count=0;
    while(it.hasNext()) {
      stat=(Statement) it.next();
      if(stat instanceof Tag) {
        tag=(Tag) stat;
        if(tag.getTagLibTag().getTagClassName().equals(className)) count++;
      }
    }
    if(count>1)
      throw new EvaluatorException("inside one cfc file only one tag "+tlt.getFullName()+" is allowed, now we have "+count);

    boolean isComponent="railo.runtime.tag.Component".equals(tlt.getTagClassName());
    boolean isInterface="railo.runtime.tag.Interface".equals(tlt.getTagClassName());
    if(isComponent)page.setIsComponent(true);
    if(isInterface)page.setIsInterface(true);
   
// Attributes
   
    // output
    // "output=true" wird in "railo.transformer.cfml.attributes.impl.Function" geh�ndelt
    Attribute attr = tag.getAttribute("output");
    if(attr!=null) {
      Expression expr = CastBoolean.toExprBoolean(attr.getValue());
      if(!(expr instanceof LitBoolean))
        throw new EvaluatorException("Attribute output of the Tag "+tlt.getFullName()+", must contain a static boolean value (true or false, yes or no)");
      //boolean output = ((LitBoolean)expr).getBooleanValue();
      //if(!output) ASMUtil.removeLiterlChildren(tag, true);
    }
   
    // extends
    attr = tag.getAttribute("extends");
    if(attr!=null) {
      Expression expr = CastString.toExprString(attr.getValue());
      if(!(expr instanceof LitString)) throw new EvaluatorException("Attribute extends of the Tag "+tlt.getFullName()+", must contain a literal string value");
    }
   
    // implements
    if(isComponent){
      attr = tag.getAttribute("implements");
      if(attr!=null) {
        Expression expr = CastString.toExprString(attr.getValue());
        if(!(expr instanceof LitString)) throw new EvaluatorException("Attribute implements of the Tag "+tlt.getFullName()+", must contain a literal string value");
      }
    }
  }
View Full Code Here

         
          if(attr!=null) {
            ExprString expr = CastString.toExprString(attr.getValue());
           
            if(!(expr instanceof LitString))
              throw new EvaluatorException(
            "the attribute access of the Tag function inside an interface must contain a constant value");
            String access = ((LitString)expr).getString().trim();
            if(!"public".equalsIgnoreCase(access))
              throw new EvaluatorException(
            "the attribute access of the tag function inside an interface definition can only have the value [public] not ["+access+"]");
          }
          else t.addAttribute(new Attribute(false,"access",LitString.toExprString("public"),"string"));
         
        }
        else throw new EvaluatorException("tag "+libTag.getFullName()+" can only contain function definitions.");
      }
    }
   
   
  }
View Full Code Here

    String queryName=ns+"catch";
   
   
    if(!ASMUtil.hasAncestorTryStatement(tag)){
      if(tag.isScriptBase())
        throw new EvaluatorException("Wrong Context, statement "+libTag.getName()+" must be inside a "+queryName+" tag or catch statement");
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be inside a "+queryName+" tag");
     
    }
    //ASMUtil.replace(tag,new TagReThrow(tag));
  }
View Full Code Here

    String ns=libTag.getTagLib().getNameSpaceAndSeparator();
      String invokeName=ns+"invoke";
   
    // check if tag is direct inside if
    if(!ASMUtil.hasAncestorTag(tag,invokeName))
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be inside a "+invokeName+" tag")
  }
View Full Code Here

    String ns=libTag.getTagLib().getNameSpaceAndSeparator();
      String httpName=ns+"pdf";
   
    // check if tag is direct inside if
    if(!ASMUtil.hasAncestorTag(tag,httpName))
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be inside a "+httpName+" tag")
  }
View Full Code Here

  public void evaluate(Tag tag,TagLibTag libTag) throws EvaluatorException {
    String ns=libTag.getTagLib().getNameSpaceAndSeparator();
    String name=ns+"catch";
   
    if(getAncestorCatch(libTag.getTagLib(),tag)==null)
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be inside a "+name+" tag");
  }
View Full Code Here

  public void evaluate(Tag tag,TagLibTag libTag) throws EvaluatorException {
    String ns=libTag.getTagLib().getNameSpaceAndSeparator();
    String queryName=ns+"query";
   
    if(!ASMUtil.hasAncestorTag(tag,queryName))
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be inside a "+queryName+" tag");
  }
View Full Code Here

    String ns=libTag.getTagLib().getNameSpaceAndSeparator();
      String ifName=ns+"if";
   
    // check if tag is direct inside if
    if(!ASMUtil.isParentTag(tag, TagIf.class))
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be direct inside a "+ifName+" tag");   
  }
View Full Code Here

  // check parent
    String ns=libTag.getTagLib().getNameSpaceAndSeparator();
    String compName=ns+"component";
   
    if(!ASMUtil.isParentTag(tag,compName))
      throw new EvaluatorException("Wrong Context, tag "+libTag.getFullName()+" must be inside "+compName+" tag");
  }
View Full Code Here

TOP

Related Classes of railo.transformer.cfml.evaluator.EvaluatorException

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.