Package org.ow2.asm

Examples of org.ow2.asm.ClassReader.accept()


            case 'C':
                rdr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.CLASS_SIGNATURE,
                        wrt));
                break;
            case 'M':
                rdr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.METHOD_SIGNATURE,
                        wrt));
                break;
            case 'F':
                rdr.acceptType(new CheckSignatureAdapter(CheckSignatureAdapter.TYPE_SIGNATURE,
                        wrt));
View Full Code Here


        appendDescriptor(CLASS_SIGNATURE, signature);
        if (signature != null) {
            TraceSignatureVisitor sv = new TraceSignatureVisitor(access);
            SignatureReader r = new SignatureReader(signature);
            r.accept(sv);
            buf.append("// declaration: ")
                    .append(name)
                    .append(sv.getDeclaration())
                    .append('\n');
        }
View Full Code Here

            buf.append(tab);
            appendDescriptor(METHOD_SIGNATURE, signature);

            TraceSignatureVisitor v = new TraceSignatureVisitor(0);
            SignatureReader r = new SignatureReader(signature);
            r.accept(v);
            String genericDecl = v.getDeclaration();
            String genericReturn = v.getReturnType();
            String genericExceptions = v.getExceptions();

            buf.append(tab)
View Full Code Here

        SignatureWriter w = new SignatureWriter();
        SignatureVisitor a = createRemappingSignatureAdapter(w);
        if (typeSignature) {
            r.acceptType(a);
        } else {
            r.accept(a);
        }
        return w.toString();
    }

    protected SignatureVisitor createRemappingSignatureAdapter(
View Full Code Here

                    print(tcb.handler);
                    pw.println();
                }
                for (int j = 0; j < mn.instructions.size(); ++j) {
                    AbstractInsnNode in = mn.instructions.get(j);
                    in.accept(new EmptyVisitor() {

                        @Override
                        public void visitFrame(
                            int type,
                            int local,
View Full Code Here

                    @Override
                    public void test(byte[] bytes, int[] errors) {
                        ClassWriter cw = new ClassWriter(0);
                        ClassNode cn = new ClassNode();
                        new ClassReader(bytes).accept(cn, 0);
                        cn.accept(cw);
                        cw.toByteArray();
                    }
                });

        compute = false;
View Full Code Here

                    print(tcb.handler);
                    pw.println();
                }
                for (int j = 0; j < mn.instructions.size(); ++j) {
                    AbstractInsnNode in = mn.instructions.get(j);
                    in.accept(new EmptyVisitor() {

                        @Override
                        public void visitFrame(
                            int type,
                            int local,
View Full Code Here

     * @throws AnalyzerException if class is incorrect.
     */
    public static void checkClass(final byte[] bytes) throws AnalyzerException {
        ClassReader cr = new ClassReader(bytes);
        ClassNode cn = new ClassNode();
        cr.accept(new CheckClassAdapter(cn), ClassReader.SKIP_DEBUG);
        List methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            if (method.instructions.size() > 0) {
                Analyzer a = new Analyzer(new SimpleVerifier(Type.getType("L" + cn.name + ";"), Type.getType("L" + cn.superName
View Full Code Here

                // Create ClassReader/Writer
                ClassReader cr = getClassReader(classAnnotationMetadata);
                ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
                InterceptorClassAdapter cv = new InterceptorClassAdapter(classAnnotationMetadata, cw);
                InjectionClassAdapter cv2 = new InjectionClassAdapter(classAnnotationMetadata, cv, this.map, null, false);
                cr.accept(cv2, 0);
                classAnnotationMetadata.setModified();
                defineClass(this.loader, classAnnotationMetadata.getClassName().replace("/", "."), cw.toByteArray());
            }
        }
        // search all beans
View Full Code Here

                        Migration21ClassAdapter ejb21Adapter = new Migration21ClassAdapter(classAnnotationMetadata, cv2);
                        beanVisitor = ejb21Adapter;
                    }


                    cr.accept(beanVisitor, 0);

                    // define subclasses if interceptor enabled
                    loadDefinedClasses(this.loader, itcpClassAdapter.getDefinedClasses());

                    defineClass(this.loader, classAnnotationMetadata.getClassName().replace("/", "."), cw.toByteArray());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.