Package org.springframework.asm

Examples of org.springframework.asm.Type


    ClassReader cr = new ClassReader(resource.getInputStream());
    cr.accept(createClassVisitor(model), false);
  }

  protected String convertAnnotationDescriptor(String desc) {
    Type t = Type.getType(desc);
    return t.getInternalName();
  }
View Full Code Here


      String field = null;

      public void visit(String arg0, Object arg1) {
        setFieldName(arg0);
        if (arg1 instanceof Type) {
          Type referenced = (Type) arg1;
          String name = referenced.getClassName();
          Type annotationClass = Type.getType(desc);
          AnnotationHandle ah = new AnnotationHandle(field, handle, MemberHandle
              .convertClassName(annotationClass.getClassName()));
          model.addAnnotationReference(MemberHandle.convertClassName(name), ah);
          addDependency(handle.getDeclaringClass(), model, referenced);
        }
      }
View Full Code Here

    };
  }

  private void addDependency(final String className, final ProjectModelImpl model, String desc, boolean returnType) {
      Type t = returnType ? Type.getReturnType(desc) : Type.getType(desc);
      addDependency(className, model, t);
  }
View Full Code Here

    mv.visitMethodInsn(INVOKESPECIAL, INSTANTIATOR_NAME, INIT, voidArgClassAndIntDescriptor);
    mv.visitInsn(RETURN);
    mv.visitMaxs(3, 3);
    mv.visitEnd();

    Type customClassType = Type.getType(clazz);
    String customTypeNoArgDesc = Type.getMethodDescriptor(customClassType, new Type[] {});

    // newInstance overloaded method
    mv = cw.visitMethod(ACC_PUBLIC, NEW_INSTANCE, customTypeNoArgDesc, null, null);

    mv.visitCode();
    mv.visitTypeInsn(NEW, customClassType.getInternalName());
    mv.visitInsn(DUP);
    mv.visitMethodInsn(INVOKESPECIAL, customClassType.getInternalName(), INIT, voidNoArgMethodDescriptor);
    mv.visitInsn(ARETURN);
    mv.visitMaxs(2, 1);
    mv.visitEnd();

    // plus original method signature
View Full Code Here

    Type[] types = Type.getArgumentTypes(desc);
    StringBuffer buf = new StringBuffer(name);
    if (types != null && types.length > 0) {
      buf.append("(");
      for (int i = 0; i < types.length; i++) {
        Type type = types[i];
        buf.append(type.getClassName());
        if (i < (types.length - 1)) {
          buf.append(", ");
        }
      }
      buf.append(")");
View Full Code Here

TOP

Related Classes of org.springframework.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.