Package cn.wensiqun.asmsupport.clazz

Examples of cn.wensiqun.asmsupport.clazz.AClass


        //找到的方法
        List<MethodEntity> mes = new ArrayList<MethodEntity>();
       
        List<TypeTreeNode[]> foundMethodArguments = new ArrayList<TypeTreeNode[]>();
       
        AClass invoked = AClassFactory.getProductClass(javaClass);

        for (TypeTreeNode[] ttns : allArgTypes) {

          //java.lang.reflect.Method method = null;
            Class<?> actuallyMethodOwner = javaClass;

            Class<?>[] argclses = new Class<?>[orgiArguTypes.length];
            for(int i=0; i<argclses.length; i++){
                try{
                    argclses[i] = ((ProductClass) ttns[i].type).getReallyClass();
                }catch(ClassCastException cce){
                    try {
                        argclses[i] = ClassUtils.forName(((ArrayClass) ttns[i].type).getDescription());
                    } catch (ClassNotFoundException e) {
                      throw new ASMSupportException("Class not found exception : " + ((ArrayClass) ttns[i].type).getDescription() ,e);
                    }
                }
            }
           
            AClass[] pcs;
            boolean sameToPass = true;
            MethodEntity me;
            for (; actuallyMethodOwner != null; ) {
                try {
                  AClass methodReturnType = null;
                  int methodMidifiers;
                  AClass[] exceptionTypes;
                 
                  if(name.equals(ASConstant.INIT)){
                        Constructor<?> constructor = actuallyMethodOwner.getDeclaredConstructor(argclses);
View Full Code Here


            if(!canConvertedByMethodInvocationConversion(argumentTypes[i], formalParas[i])){
                return false;
            }
        }
        //the last parameter of variable arity method must be array
        AClass lastVariableVarify = ((ArrayClass)formalParas[formalParas.length - 1]).getNextDimType();
        for(int i = formalParas.length - 1; i < argumentTypes.length; i++){
            if(!canConvertedByMethodInvocationConversion(argumentTypes[i], lastVariableVarify)){
                return false;
            }
        }
View Full Code Here

        Class<?> actually = cls;
        MethodEntity me;
       
        for(; actually != null ;){
            try {
              AClass methodReturnType = null;
              int methodMidifiers;
              AClass[] exceptionTypes;
             
              if(name.equals(ASConstant.INIT)){
                    Constructor<?> constructor = actually.getDeclaredConstructor();
                    methodMidifiers = constructor.getModifiers();
                    exceptionTypes = convertToAClass(constructor.getExceptionTypes());
              }else{
                    Method method = actually.getDeclaredMethod(name);
                    methodReturnType = AClassFactory.getProductClass(method.getReturnType());
                    methodMidifiers = method.getModifiers();
                    exceptionTypes = convertToAClass(method.getExceptionTypes());
              }
             
                AClass invoked =  AClassFactory.getProductClass(cls);
                AClass actuallyInvoked = AClassFactory.getProductClass(actually);
               
                if(!AClassUtils.visible(invoker, invoked, actuallyInvoked, methodMidifiers)){
                    throw new ASMSupportException("cannot invoke method by the modifiers " + Modifier.toString(methodMidifiers));
                }
               
View Full Code Here

        checkMember(member);
        //continueLbl = new Label();
    }
   
    private void checkMember(MemberVariable member){
        AClass cls = member.getParamterizedType();
        if(!cls.isArray() &&
           !cls.isChildOrEqual(AClassFactory.getProductClass(Iterable.class))){
            throw new ASMSupportException("The object must be an array or an object that implements the new Iterable interface.");
        }
    }
View Full Code Here

*/
public abstract class InitBody extends SuperMethodBody implements IInitBody {

  @Override
  public MethodInvoker invokeSuperConstructor(Parameterized... arguments) {
      AClass owner = getMethodOwner();
      if(ModifierUtils.isEnum(getMethodOwner().getModifiers())){
        throw new ASMSupportException("Cannot invoke super constructor from enum type " + owner);
      }
        invokeVerify(owner);

View Full Code Here

   
   
    @Override
    protected void executingProcess() {
        MethodVisitor mv = insnHelper.getMv();
        AClass ftrCls1 = factor1.getParamterizedType();
        AClass ftrCls2 = factor2.getParamterizedType();
       
        factor1.loadToStack(block);
        insnHelper.unbox(ftrCls1.getType());
        mv.visitJumpInsn(Opcodes.IFNE, trueLbl);
       
        factor2.loadToStack(block);
        insnHelper.unbox(ftrCls2.getType());
        mv.visitJumpInsn(Opcodes.IFNE, trueLbl);

        mv.visitInsn(Opcodes.ICONST_0);
        mv.visitJumpInsn(Opcodes.GOTO, falseLbl);
        mv.visitLabel(trueLbl);
View Full Code Here

      Class<?> calledFunOwner = calledFunOwners[idx];
      FunctionInfo calledFun = calledFuns.get(idx);
     
      if(desc.equals(calledFunDesc) && name.equals(calledFunName)){
        try{
          AClass ownerClass = AClassFactory.getProductClass( CommonUtils.forName(owner.replace("/", "."), true, classLoader));
          AClass byInvokedMethodOwnerAClass = AClassFactory.getProductClass(calledFunOwner);
          if(ownerClass.isChildOrEqual(byInvokedMethodOwnerAClass)){
           
            int argumentsSize = calledFun.getParameterTypes().length;
            List<Type> allTypeInStack = new ArrayList<Type>();
            for(int i=0; i<argumentsSize;i++){
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.