Package cn.wensiqun.asmsupport.clazz

Examples of cn.wensiqun.asmsupport.clazz.AClass


        this.execute();
    }
   
    @Override
    protected void verifyArgument() {
        AClass f1cls = factor1.getParamterizedType();
        AClass f2cls = factor2.getParamterizedType();
        if(!AClassUtils.arithmetical(f1cls) || !AClassUtils.arithmetical(f2cls)){
            throw new ArithmeticException("cannot execute arithmetic operator whit " + f1cls + " and " + f2cls);
        }
    }
View Full Code Here


        factor2.asArgument();
    }

    @Override
    protected void afterInitProperties() {
        AClass f1cls = factor1.getParamterizedType();
        AClass f2cls = factor2.getParamterizedType();
        f1cls = AClassUtils.getPrimitiveAClass(f1cls);
        f2cls = AClassUtils.getPrimitiveAClass(f2cls);
       
        if(f1cls.getCastOrder() > f2cls.getCastOrder()){
            resultClass = f1cls;
        }else{
            resultClass = f2cls;
        }
    }
View Full Code Here

        if (!(obj instanceof Value)) {
            return false;
        }

        Value objval = (Value) obj;
        AClass curtyp = getParamterizedType();
        AClass objtyp = objval.getParamterizedType();

        if (value == null && objval.value == null) {
            if (curtyp.isChildOrEqual(objtyp)
                    || objtyp.isChildOrEqual(curtyp)) {
                return true;
            } else if (Modifier.isAbstract(curtyp.getModifiers())
                    && Modifier.isFinal(objtyp.getModifiers())) {
                return false;
            } else if (Modifier.isAbstract(objtyp.getModifiers())
                    && Modifier.isFinal(curtyp.getModifiers())) {
                return false;
            } else {
                return true;
            }
View Full Code Here

        }
    }

    @Override
    protected void factorToStack() {
        AClass ftrCls1 = factor1.getParamterizedType();
        AClass ftrCls2 = factor2.getParamterizedType();
       
        log.debug("push the first arithmetic factor to stack");
        factor1.loadToStack(block);
       
        if(!ftrCls1.isPrimitive()){
            log.debug("unbox " + ftrCls1);
            insnHelper.unbox(ftrCls1.getType());
        }
       
        if(!ftrCls1.equals(resultClass) &&
            resultClass.getCastOrder() > AClass.INT_ACLASS.getCastOrder() ){
            log.debug("cast arithmetic factor from " + ftrCls1 + " to " + resultClass);
            insnHelper.cast(ftrCls1.getType(), resultClass.getType());   
        }

       
        log.debug("push the second arithmetic factor to stack");
        factor2.loadToStack(block);
       
        if(!ftrCls2.isPrimitive()){
            log.debug("unbox " + ftrCls2);
            insnHelper.unbox(ftrCls2.getType());
        }
       
        if(!ftrCls2.equals(resultClass) &&
            resultClass.getCastOrder() > AClass.INT_ACLASS.getCastOrder() ){
            log.debug("cast arithmetic factor from " + ftrCls2 + " to " + resultClass);
            insnHelper.cast(ftrCls2.getType(), resultClass.getType());   
        }
       
    }
View Full Code Here

                }
            }
        }

      //当调用其他构造方法
      final AClass rootComp = arrayCls.getRootComponentClass();
        new EachValue(values){
            @Override
            void process(Parameterized para) {
              AClassUtils.autoCastTypeCheck(para.getParamterizedType(), rootComp);
            }
View Full Code Here

    private void loopArray(AClass acls, Object arrayOrElement){
        InstructionHelper ih = block.getInsnHelper();
        if(arrayOrElement.getClass().isArray()){
            int len = Array.getLength(arrayOrElement);
            ih.push(len);
            AClass nextDimType = ((ArrayClass)acls).getNextDimType();
            ih.newArray(nextDimType.getType());
            if(len > 0){
                ih.dup()
            }
            for(int i=0; i<len ;i++){
                ih.push(i);
View Full Code Here

        this.factor2 = factor2;
    }

    @Override
    protected void verifyArgument() {
        AClass ftrCls1 = factor1.getParamterizedType();
        AClass ftrCls2 = factor2.getParamterizedType();
       
        checkFactor(ftrCls1);
        checkFactor(ftrCls2);
    }
View Full Code Here

        factor2.asArgument();
    }

    @Override
    protected void afterInitProperties() {
        AClass ftrCls1 = factor1.getParamterizedType();
        AClass ftrCls2 = factor2.getParamterizedType();
       
        if(ftrCls2.getCastOrder() < ftrCls1.getCastOrder()){
            resultClass = ftrCls1;
        }else{
            resultClass = ftrCls2;
        }
    }
View Full Code Here

        if(ModifierUtils.isVarargs(entity.getModifier())){
          if(ArrayUtils.getLength(argumentTypes) == 0){
            return;
          }
         
          AClass lastActuallyArg = argumentTypes[ArrayUtils.getLength(argumentTypes) - 1];
         
          if(!lastActuallyArg.isArray() ||
            ArrayUtils.getLength(argumentTypes) != ArrayUtils.getLength(potentialMethodArgs)) {
            return;
          }
        }
        for(int i=0, len = ArrayUtils.getLength(potentialMethodArgs); i<len; i++){
          AClass actuallyArg = argumentTypes[i];
          AClass potentialArg = potentialMethodArgs[i];
          if(!AClassUtils.isSubOrEqualType(actuallyArg, potentialArg))
            return;
        }
        list.add(entity);
      }
View Full Code Here

        if(ModifierUtils.isVarargs(entity.getModifier())){
          return;
        }
        AClass[] potentialMethodArgs = entity.getArgClasses();
        for(int i=0, len = ArrayUtils.getLength(potentialMethodArgs); i<len; i++){
          AClass actuallyArg = argumentTypes[i];
          AClass potentialArg = potentialMethodArgs[i];
          if(!canBeConvertedByMethodInvocationConversion(actuallyArg, potentialArg))
            return;
        }
        list.add(entity);
      }
View Full Code Here

TOP

Related Classes of cn.wensiqun.asmsupport.clazz.AClass

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.