Package railo.transformer.bytecode.statement.tag

Examples of railo.transformer.bytecode.statement.tag.Attribute


     
      // check if default can be converted to a literal value that match the type declration.
      checkDefaultValue(tag);
       
      // check attribute passby
      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))
View Full Code Here


      // TODO check if there is a tag other than argument and text before 
     
    }

  public static void checkDefaultValue(Tag tag) {
    Attribute _type = tag.getAttribute("type");
    if(_type!=null) {
      ExprString typeValue = CastString.toExprString(_type.getValue());
      if(typeValue instanceof LitString) {
        String strType=((LitString)typeValue).getString();
        Attribute _default = tag.getAttribute("default");
        if(_default!=null) {
          Expression defaultValue = _default.getValue();
          if(defaultValue instanceof LitString) {
            String strDefault=((LitString)defaultValue).getString();
           
           
           
            // check for boolean
            if("boolean".equalsIgnoreCase(strType)) {
              if("true".equalsIgnoreCase(strDefault) || "yes".equalsIgnoreCase(strDefault))
                tag.addAttribute(new Attribute(_default.isDynamicType(),_default.getName(), LitBoolean.TRUE, _default.getType()));
              if("false".equalsIgnoreCase(strDefault) || "no".equalsIgnoreCase(strDefault))
                tag.addAttribute(new Attribute(_default.isDynamicType(),_default.getName(), LitBoolean.FALSE, _default.getType()));
            }

            // check for numbers
            if("number".equalsIgnoreCase(strType) || "numeric".equalsIgnoreCase(strType)) {
              Double dbl = Caster.toDouble(strDefault,null);
              if(dbl!=null) {
                tag.addAttribute(new Attribute(_default.isDynamicType(),_default.getName(), LitDouble.toExprDouble(dbl.doubleValue()), _default.getType()));
              }
            }
          }
        }
      }
View Full Code Here

  /**
   * @see railo.transformer.cfml.evaluator.EvaluatorSupport#evaluate(org.w3c.dom.Element, railo.transformer.library.tag.TagLibTag)
   */
  public void evaluate(Tag tag) throws EvaluatorException {
    tag.addAttribute(
        new Attribute(
            false,
            "id",
            LitString.toExprString(Caster.toString((int)(Math.random()*100000))),
            "string"
        ));
 
View Full Code Here

    String loopName=ns+"loop";
    String whileName=ns+"while";
   
    // label
    String label=null;
    Attribute attrLabel = tag.getAttribute("label");
    if(attrLabel!=null){
      TagContinue tc=(TagContinue) tag;
      label=Break.variableToString(tag,attrLabel,null);
      if(label!=null){
        tc.setLabel(label=label.trim());
View Full Code Here

   

    // label
    String label=null;
   
    Attribute attrLabel = tag.getAttribute("label");
    if(attrLabel!=null){
      TagBreak tb=(TagBreak) tag;
      label=variableToString(tag,attrLabel,null);
      if(label!=null){
        tb.setLabel(label=label.trim());
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.statement.tag.Attribute

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.