Package railo.transformer.bytecode

Examples of railo.transformer.bytecode.BytecodeException


  }


  public static TagOutput getParentTagOutputQuery(Statement stat) throws BytecodeException {
    Statement parent=stat.getParent();
    if(parent==null) throw new BytecodeException("there is no parent output with query",null);
    else if(parent instanceof TagOutput) {
      if(((TagOutput)parent).hasQuery())
        return ((TagOutput)parent);
    }
    return getParentTagOutputQuery(parent);
View Full Code Here


      TagGroupUtil.writeOutTypeQuery(this,bc);
      bc.changeDoSubFunctions(old);
    break;
   
    default:
      throw new BytecodeException("invalid type",getStart());
    }
  }
View Full Code Here

    //adapter.pop();
  }
 
  public static TagGroup getParentTagGroupQuery(Statement st, short type) throws BytecodeException {
    Statement parent=st.getParent();
    if(parent==null) throw new BytecodeException("there is no parent output with query",null);
    else if(parent instanceof TagGroup && type==((TagGroup)parent).getType()) {
      if(((TagGroup)parent).hasQuery())
        return ((TagGroup)parent);
    }
    return getParentTagGroupQuery(parent,type);
View Full Code Here

  public final void addAttribute(Attribute attr) throws TemplateException {
    String name=attr.getName().toLowerCase();
    // name
    if("name".equals(name))  {
      throw new BytecodeException("name cannot be defined twice",getStart());
      //this.name=CastString.toExprString(attr.getValue());
    }
    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;
     
    }
   
    else if("output".equals(name))    this.output=toLitBoolean(name,attr.getValue());
    else if("bufferoutput".equals(name))this.bufferOutput=toLitBoolean(name,attr.getValue());
    else if("displayname".equals(name))  this.displayName=toLitString(name,attr.getValue());
    else if("hint".equals(name))    this.hint=toLitString(name,attr.getValue());
    else if("description".equals(name))  this.description=toLitString(name,attr.getValue());
    else if("returnformat".equals(name))this.returnFormat=toLitString(name,attr.getValue());
    else if("securejson".equals(name))  this.secureJson=toLitBoolean(name,attr.getValue());
    else if("verifyclient".equals(name))  this.verifyClient=toLitBoolean(name,attr.getValue());
    else if("localmode".equals(name))  {
      Expression v = attr.getValue();
      if(v!=null) {
        String str = ASMUtil.toString(v,null);
        if(!StringUtil.isEmpty(str)){
          int mode = AppListenerUtil.toLocalMode(str, -1);
          if(mode!=-1) this.localMode=LitInteger.toExpr(mode);
          else throw new BytecodeException("Attribute localMode of the Tag Function, must be a literal value (modern, classic, true or false)",getStart());
        }
      }
    }
    else if("cachedwithin".equals(name))  {
      try {
View Full Code Here

  }

  private final LitString toLitString(String name, Expression value) throws BytecodeException {
    ExprString es = CastString.toExprString(value);
    if(!(es instanceof LitString))
      throw new BytecodeException("value of attribute ["+name+"] must have a literal/constant value",getStart());
    return (LitString) es;
  }
View Full Code Here

  }
 
  private final LitBoolean toLitBoolean(String name, Expression value) throws BytecodeException {
     ExprBoolean eb = CastBoolean.toExprBoolean(value);
    if(!(eb instanceof LitBoolean))
      throw new BytecodeException("value of attribute ["+name+"] must have a literal/constant value",getStart());
    return (LitBoolean) eb;
  }
View Full Code Here

  }
 
  private final ExprInt toLitInt(String name, Expression value) throws BytecodeException {
    ExprInt eb = CastInt.toExprInt(value);
    if(!(eb instanceof Literal))
      throw new BytecodeException("value of attribute ["+name+"] must have a literal/constant value",getStart());
    return eb;
  }
View Full Code Here

  private static Type getTagType(Tag tag) throws BytecodeException {
    TagLibTag tlt = tag.getTagLibTag();
    try {
      return tlt.getTagType();
    } catch (ClassException e) {
      throw new BytecodeException(e,tag.getStart());
    }
  }
View Full Code Here

      }
        try {
      return Type.getType(ClassUtil.loadClass(type));
    }
        catch (ClassException e) {
      throw new BytecodeException(e.getMessage(),null);
    }
   
  }
View Full Code Here

          addCase(bc,cv,tag,expression);
          continue;
        }
        else if(tag.getTagLibTag().getTagClassName().equals("railo.runtime.tag.Defaultcase"))  {
          if(def!=null)
            throw new BytecodeException("multiple defaultcases are not allowed",getStart());
          def=tag;
          //setDefaultCase(bc,cv,tag);
          //break;
        }
      }
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.