Package org.objectweb.asm

Examples of org.objectweb.asm.Type


    vr.verifySingleClass(classfile);
    vr.displaySummary();
  }
 
  private void checkClassName(String className) {
    Type t = Type.getType(className);
    String name;

    switch (t.getSort()) {
    case Type.ARRAY:
      t = t.getElementType();
      if (t.getSort() != Type.OBJECT) {
        return;
      }

      // fall through to object processing
    case Type.OBJECT:
      name = t.getClassName();
      break;
    default:
      return;
    }
   
View Full Code Here


            double val = ((Double) cst).doubleValue();
            return newDouble(val);
        } else if (cst instanceof String) {
            return newString((String) cst);
        } else if (cst instanceof Type) {
            Type t = (Type) cst;
            return newClass(t.getSort() == Type.OBJECT
                    ? t.getInternalName()
                    : t.getDescriptor());
        } else {
            throw new IllegalArgumentException("value " + cst);
        }
    }
View Full Code Here

          if (opcode == RETURN) {
              // add call to setEnumValues(Object[] values, Class c)

              String owner = className.replace('.', '/');
              String fullName = 'L' + owner + ';';
              Type t = Type.getType(fullName);

              mv.visitMethodInsn(INVOKESTATIC, owner, "values", "()[" + fullName);
              mv.visitLdcInsn(t);
              mv.visitMethodInsn(INVOKESTATIC, "com/rc/retroweaver/runtime/Enum_",
                  "setEnumValues", "([Ljava/lang/Object;Ljava/lang/Class;)V");        
View Full Code Here

         * it was generated in 1.4.
         */

        // LDC or LDC_W with a class as argument

        Type t = (Type) cst;
        String fieldName = getClassLiteralFieldName(t);

        classLiteralCalls.add(fieldName);

        mv.visitFieldInsn(GETSTATIC, className, fieldName, CLASS_FIELD_DESC);
        Label nonNullLabel = new Label();
        mv.visitJumpInsn(IFNONNULL, nonNullLabel);
        String s;
        if (t.getSort() == Type.OBJECT)
          s = t.getInternalName();
        else
          s = t.getDescriptor();
       
        /* convert retroweaver runtime classes:
         *     Enum into com.rc.retroweaver.runtime.Enum_
         *    concurrent classes into their backport equivalent
         *    ...
 
View Full Code Here

    vr.verifySingleClass(classfile);
    vr.displaySummary();
  }
 
  private void checkClassName(String className) {
    Type t = Type.getType(className);

    switch (t.getSort()) {
    case Type.ARRAY:
      t = t.getElementType();
      if (t.getSort() != Type.OBJECT)
        return;

      // fall through to object processing
    case Type.OBJECT:
      className = t.getClassName();
      break;
    default:
      return;
    }
   
View Full Code Here

    private static void loadArgs(MethodVisitor mv, int access, Type[] args) {
        int i = 0;
        int j = args.length;
        int k = getArgIndex(access, args, i);
        for (int l = 0; l < j; l++) {
            Type type = args[i + l];
            mv.visitVarInsn(type.getOpcode(ILOAD), k);
            k += type.getSize();
        }
    }
View Full Code Here

        if(!!!samePackage)
          throw new RuntimeException(NLS.MESSAGES.getMessage("method.from.superclass.is.hidden", name, superToCopy.getName(), overridingClassType.getClassName()),
                                     new UnableToProxyException(superToCopy));
      }
      //Safe to copy a call to this method!
      Type superType = Type.getType(superToCopy);
     
      // identify the target method parameters and return type
      String methodStaticFieldName = "methodField" + AbstractWovenProxyAdapter.getSanitizedUUIDString();
      transformedMethods.put(methodStaticFieldName, new TypeMethod(
          superType, currentTransformMethod))
View Full Code Here

        }
        // Invocation
        mv.visitMethodInsn(INVOKEINTERFACE, itfName, methodName, desc);

        // Return the result
        Type returnType = Type.getReturnType(desc);
        if (returnType.getSort() != Type.VOID) {
            mv.visitInsn(returnType.getOpcode(IRETURN));
        } else {
            mv.visitInsn(RETURN);
        }

        // End of the method.
View Full Code Here

        for (int i = 0; i < parameters.size(); i++) {
            ParameterDesc parameterDesc = (ParameterDesc) parameters.get(i);
            parameterASMTypes[i] = Type.getType(parameterDesc.getJavaType());
        }

        Type returnASMType = (operationDesc.getReturnClass() != null) ? Type.getType(operationDesc.getReturnClass()) : Type.VOID_TYPE;

        String methodDesc = Type.getMethodDescriptor(returnASMType, parameterASMTypes);
        OperationInfo operationInfo = new OperationInfo(operationDesc, usesSOAPAction, soapActionURI, soapVersion, operationQName, methodName, methodDesc);
        return operationInfo;
    }
View Full Code Here

            if (arg0.equals("id")) {
                m_id = arg1.toString();
                return;
            }
            if (arg0.equals("comparator")) {
                Type type = Type.getType(arg1.toString());
                m_comparator = type.getClassName();
                return;
            }
            if (arg0.equals("from")) {
                m_from = arg1.toString();
                return;
View Full Code Here

TOP

Related Classes of org.objectweb.asm.Type

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.