Package cn.wensiqun.asmsupport.exception

Examples of cn.wensiqun.asmsupport.exception.ASMSupportException


    public ProgramBlock getCopy(){
        try {
            return (ProgramBlock) clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            throw new ASMSupportException();
        }
    }
View Full Code Here


  }
   
    @Override
    public final ThisVariable getThis() {
      if(getMethod().isStatic()){
        throw new ASMSupportException("cannnot use \"this\" keyword in static block");
      }
        return method.getMethodOwner().getThisVariable();
    }
View Full Code Here

    }
   
    @Override
    public final SuperVariable getSuper() {
      if(getMethod().isStatic()){
        throw new ASMSupportException("cannnot use \"this\" keyword in statc block");
      }
        return method.getMethodOwner().getSuperVariable();
    }
View Full Code Here

          return invokeStatic(getMethod().getMethodOwner(), methodNameByProxy, getMethodArguments());
        }else{
            return invoke(getThis(), methodNameByProxy, getMethodArguments());
        }
      }else{
        throw new ASMSupportException("this method is new and not modify!");
      }
    }
View Full Code Here

       
        //如果不是静态类则加载当前变量的引用入栈
        if(!Modifier.isStatic(var.getVariableEntity().getModifiers())){
            //如果当前方法是静态的抛异常
            if(Modifier.isStatic(block.getMethod().getMethodEntity().getModifier())){
              throw new ASMSupportException("current method " + block.getMethod() + " is static cannot use non-static field " + var.getVariableEntity().getName() );
            }
            var.getVariableOwner().loadToStack(block);
        }
       
       
View Full Code Here

    }

    @Override
    protected void verifyArgument() {
        if(obj.getParamterizedType().isPrimitive()){
            throw new ASMSupportException("Incompatible conditional operand types " + obj.getParamterizedType() + " int and " + type);
        }
    }
View Full Code Here

    @Override
    public void execute() {
        if(byOtherUsed){
            super.execute();
        }else{
            throw new ASMSupportException("the instanceof operator has not been used by other operator.");
        }
    }
View Full Code Here

   * @return
   */
  public static <T extends AbstractOperator> T newOperator(Class<T> clazz, Class<?>[] parameterTypes, Object... arguments){
    if(parameterTypes != null && arguments != null){
      if(!ArrayUtils.isSameLength(parameterTypes, arguments)){//parameterTypes.length != arguments.length){
        throw new ASMSupportException();
      }
    }else if(ArrayUtils.isEmpty(parameterTypes) || ArrayUtils.isEmpty(arguments)){
      throw new NullPointerException();
    }else if(!ProgramBlock.class.equals(parameterTypes[0])){
        throw new ASMSupportException("first argument type must be ProgramBlock")
    }
   
    ProgramBlock executeBlock = (ProgramBlock) arguments[0];
   
    executeBlock.tiggerTryCatchPrepare();
View Full Code Here

    @Override
    public void execute() {
        if(byOtherUsed){
            super.execute();
        }else{
            throw new ASMSupportException("the string append operator has not been used by other operator.");
        }
    }
View Full Code Here

  @Override
    protected void verifyArgument() {
        AClass excAcls = exception.getParamterizedType();
        if(!excAcls.isChildOrEqual(AClass.THROWABLE_ACLASS)){
            throw new ASMSupportException("the throw type " + excAcls + " is not assign from java.lang.Throwable.class");
        }
    }
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.