Package cn.wensiqun.asmsupport.exception

Examples of cn.wensiqun.asmsupport.exception.ASMSupportException


     * @return
     */
    public Finally finallyThan(Finally fny){
      //如果已经catch了异常则不能直接通过try创建finally块
        if(this.catchEntity != null){
            throw new ASMSupportException("has been catch exception. please create finally block by Catch");
        }
        setFinallyBlock(fny);
        fny.setPrevious(this);

        subBlockPrepare(fny, getOwnerBlock());
View Full Code Here


       
        if(finallyBlock != null){
          return finallyBlock.startLbl;
        }
     
        throw new ASMSupportException("insert \"Finally\"  or \"Catch\" to complete TryStatement");
       
    }
View Full Code Here

     * @param name
     * @return
     */
    protected final GlobalVariable getGlobalVariable(AClass aclass, String name){
        if(this.getParamterizedType() instanceof ArrayClass){
            throw new ASMSupportException("cannot get global variable from array type variable : " + this);
        }
     
      VariableEntity ve = aclass.getGlobalVariableEntity(name);
        if(ve == null){
          throw new IllegalArgumentException("dosn't exist or cannot access \"" + name + "\" property of class " + aclass);
View Full Code Here

            //use the first phase's algorithm
            me = scmc.firstPhase();
            if(me != null){
                foundNumber++;
                if(foundNumber > 1){
                    throw new ASMSupportException(" Ambiguous ...............");
                }
            }
        }
       
        return me;
View Full Code Here

        List<TypeTreeNode[]> appliNodes = applicableVariableVarifyMethodArgumentsNodes(applicable);
       
        if(appliNodes.size() > 0){
            int mostIndex = mostSpecificIndexForVariableVarify(appliNodes);
            if(mostIndex == -1){
                throw new ASMSupportException(" Ambiguous ...............");
            }else{
                MethodEntity me = applicable.get(mostIndex);
                return me;
            }
        }else{
View Full Code Here

     * @return
     */
    public void createGlobalVariable(String name, int modifiers,
            AClass fieldClass) {
        if(!existEnumConstant){
            throw new ASMSupportException("first field must be an enum object of current enum type " + sc.getName());
        }
        GlobalVariableCreator fc = new GlobalVariableCreator(name, modifiers,
                fieldClass);
        fieldCreators.add(fc);
        existField = !ModifierUtils.isEnum(modifiers);
View Full Code Here

     * @param name
     * @return
     */
    public void createEnumConstant(String name){
        if(existField){
            throw new ASMSupportException("declare enum constant must before other field");
        }
      existEnumConstant = true;
      sc.setEnumNum(sc.getEnumNum() + 1);
      enumConstantNameList.add(name);
        createGlobalVariable(name, Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL + Opcodes.ACC_ENUM, sc);
View Full Code Here

            insnHelper.unbox(from.getType());
            insnHelper.cast(primType, to.getType());
            return;
        }
       
        throw new ASMSupportException("cannot auto cast from " + from + " to " + to + " also you can use CheckCast to try again!");
       
    }
View Full Code Here

  public ClassModifier(Class<?> clazz) {
    super();
    if(!clazz.isArray()){
      this.productClass = (ProductClass) AClassFactory.getProductClass(clazz);
    }else{
      throw new ASMSupportException("cannot modify array type : " + clazz);
    }
    methodCreaters = new ArrayList<IMethodCreator>();
    methodModifiers = new ArrayList<IMethodCreator>();
    fieldCreators = new ArrayList<IGlobalVariableCreator>();
  }
View Full Code Here

            if(StringUtils.isNotBlank(getClassOutPutPath())){
            ClassFileUtils.toLocal(modifiedBytes, getClassOutPutPath(), proxyClassName);
          }
      return loadClass(proxyClassName, modifiedBytes);
    } catch (ClassNotFoundException e) {
      throw new ASMSupportException("Class Not Found Exception");
    } finally{
          //cleanCach();
    }
  }
View Full Code Here

TOP

Related Classes of cn.wensiqun.asmsupport.exception.ASMSupportException

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.