Package org.objectweb.asm

Examples of org.objectweb.asm.Type


  private void inspectType(File file, List<ArtemisTypeData> destination) {
    FileInputStream stream = null;
    try {
      stream = new FileInputStream(file);
      ClassReader cr = new ClassReader(stream);
      Type objectType = Type.getObjectType(cr.getClassName());
      if (!(scanner.managers.contains(objectType) || scanner.systems.contains(objectType)))
        return;
     
      ArtemisTypeData meta = scanner.scan(cr);
      meta.current = objectType;
View Full Code Here


  @Override
  public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
    if (!desc.endsWith(";"))
      return super.visitField(access, name, desc, signature, value);
   
    Type type = Type.getType(desc);
    if (resolver.systems.contains(type)) {
      config.systems.add(type);
    } else if (resolver.managers.contains(type)) {
      config.managers.add(type);
    } else if (COMPONENT_MAPPER.equals(type)) {
View Full Code Here

  }

  @Override
  public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
    if (superName != null) {
      Type superType = type(superName);
      if (mainTypes.components.contains(superType)) {
        resolver.components.add(type(name));
      } else if (mainTypes.systems.contains(superType)) {
        resolver.systems.add(type(name));
      } else if (mainTypes.managers.contains(superType)) {
View Full Code Here

  }
 
  @Override
  public void visitLdcInsn(Object cst) {
    if (cst instanceof Type) {
      Type type = (Type)cst;
      if (resolver.components.contains(cst)) {
        config.optional.add(type);
      } else if (resolver.systems.contains(type)) {
        config.systems.add(type);
      } else if (resolver.managers.contains(type)) {
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

                    .println("Found a non-Type value in value array of " + defaultAnnotation.toString() + " annotation");
                }
                continue;
            }

            Type type = (Type) obj;
            if (DEBUG_DEFAULT_ANNOTATION) {
                System.out.println("  ===> checking " + type.getDescriptor());
            }
            if (type.getDescriptor().startsWith("[")) {
                continue;
            }
            ClassDescriptor typeDesc = DescriptorFactory.instance().getClassDescriptor(type.getInternalName());

            // There is no general way to figure out whether a particular
            // type is a type qualifier we're interested in without
            // resolving it.
            AnnotationValue annotation = new AnnotationValue(typeDesc);
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

    {
        // allocate a slot for the invoke parameters array,
        // construct the array
        // stash it into the slot and return the slot idx

        Type objectType = Type.getType(Object.class);
        Type objectArrayType = Type.getType("[Ljava/lang/Object;");
        Type[] invokeParamTypes = getInvokedTypes();
        int savedValueCount = invokeParamTypes.length;

        // create the array and save it in a local var slot

        int arrayValueSlot = newLocal(objectArrayType);
        push(savedValueCount);
        newArray(objectType);
        storeLocal(arrayValueSlot);

        // pop the arguments off the stack into the invoke parameters array
        // n.b. the top one is the last parameter

        for (int i = savedValueCount - 1; i >= 0; i--) {
            Type type = invokeParamTypes[i];
            if (type != null) {
                // convert value to object if needed
                box(type);
                // load array and  swap under value
                loadLocal(arrayValueSlot);
                swap(objectArrayType, objectType);
                // load index and swap under value
                push(i);
                swap(Type.INT_TYPE, objectType);
            } else {
                // this is a static method and index is 0 so we install null in the array
                // load array index and then null
                loadLocal(arrayValueSlot);
                push(i);
                push((Type)null);
            }
            // store the value in the array as an object
            arrayStore(objectType);
        }

        // now restore the arguments from the array in increasing order

        for (int i = 0; i < savedValueCount; i++) {
            Type type = invokeParamTypes[i];
            if (type != null) {
                // load the array, retrieve the object and unbox if needed
                loadLocal(arrayValueSlot);
                push(i);
                arrayLoad(objectType);
View Full Code Here

        // create the array used to pass the bindings

        int arraySize = callArrayBindings.size();

        push(arraySize);
        Type objectType = Type.getType(Object.class);
        newArray(objectType);

        // check if any of the bindings gets updated. if so we need to stash a copy of the bindings array
        // below the key and owner so we can pull out the updated values and update local var/param slots
        // once the call ahs completed
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.