Package org.apache.xbean.asm4.signature

Examples of org.apache.xbean.asm4.signature.SignatureReader


   * Creates method signature from method name.
   */
  protected MethodSignatureVisitor createMethodSignature(int access, String methodName, String description, String signature, String classname) {
    MethodSignatureVisitor v = new MethodSignatureVisitor(methodName, access, classname, description, signature, this);
    v.hierarchyLevel = this.hierarchyLevel;
    new SignatureReader(signature != null ? signature : description).accept(v);
    return v;
  }
View Full Code Here


   * Creates method signature from method name.
   */
  protected MethodSignatureVisitor createMethodSignature(int access, String methodName, String description, String signature, String classname) {
    MethodSignatureVisitor v = new MethodSignatureVisitor(methodName, access, classname, description, signature, this);
    v.hierarchyLevel = this.hierarchyLevel;
    new SignatureReader(signature != null ? signature : description).accept(v);
    return v;
  }
View Full Code Here

    assertEquals("(java.util.List<? super java.lang.Integer>)", resolveSignature(mps[2].getSignature()));
  }


  private String resolveSignature(String signature) {
    SignatureReader signatureReader = new SignatureReader("(" + signature + ")V");
    StringBuilder sb = new StringBuilder();
    signatureReader.accept(new TraceSignatureVisitor(sb, true));
    return sb.toString();
  }
View Full Code Here

            }
            final FieldInfo fieldInfo = testFieldInfo;
            return new FieldVisitor(Opcodes.ASM4, toWrap) {
                @Override
                public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
                    final AnnotationVisitor toWrap = super.visitAnnotation(desc, visible);
                    return visible ? toWrap : new TopLevelAnnotationInflater(desc, toWrap, fieldInfo);
                }
            };
        }
View Full Code Here

            }
            final MethodInfo methodInfo = testMethodInfo;
            return new MethodVisitor(Opcodes.ASM4, toWrap) {
                @Override
                public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
                    final AnnotationVisitor toWrap = super.visitAnnotation(desc, visible);
                    return visible ? toWrap : new TopLevelAnnotationInflater(desc, toWrap, methodInfo);
                }

                @Override
                public AnnotationVisitor visitParameterAnnotation(final int param, final String desc,
                    final boolean visible) {
                    final AnnotationVisitor toWrap = super.visitParameterAnnotation(param, desc, visible);
                    if (visible) {
                        return toWrap;
                    }
                    ParameterInfo parameterInfo = null;
View Full Code Here

            };
        }

        @Override
        public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
            final AnnotationVisitor toWrap = super.visitAnnotation(desc, visible);
            return visible ? toWrap : new TopLevelAnnotationInflater(desc, toWrap, wrapped.getInfo());
        }
View Full Code Here

    private static byte[] toJava7ByteArray(BCClass bc, byte[] classBytes) throws IOException {
        ByteArrayInputStream bais = new ByteArrayInputStream(classBytes);
        BufferedInputStream bis = new BufferedInputStream(bais);

        ClassWriter cw = new BCClassWriter(ClassWriter.COMPUTE_FRAMES, bc.getClassLoader());
        ClassReader cr = new ClassReader(bis);
        cr.accept(cw, 0);
        return cw.toByteArray();
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected void readClassDef(final InputStream bytecode) throws IOException {
        try {
            final ClassReader classReader = new ClassReader(bytecode);
            classReader.accept(new Visitor(new InfoBuildingVisitor()), ASM_FLAGS);
        } finally {
            bytecode.close();
        }
    }
View Full Code Here

            final URL resource = classLoader.getResource(className);
            if (resource != null) {
                InputStream in = resource.openStream();
                in = new BufferedInputStream(in);
                try {
                    final ClassReader classReader = new ClassReader(in);
                    classReader.accept(visitor, ASM_FLAGS);
                } finally {
                    in.close();
                }
            } else {
                new Exception("Could not load " + className).printStackTrace();
View Full Code Here

    private static void file(final File file, final KeysAnnotationVisitor visitor) {
        try {
            final InputStream in = IO.read(file);
            try {
                final ClassReader classReader = new ClassReader(in);
                classReader.accept(visitor, ClassWriter.COMPUTE_MAXS);
            } finally {
                IO.close(in);
            }
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.xbean.asm4.signature.SignatureReader

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.