Package org.ow2.asm.signature

Examples of org.ow2.asm.signature.SignatureReader.accept()


            return;
        }

        StringWriter sw = new StringWriter();
        GASMifierClassVisitor cv = new GASMifierClassVisitor(new PrintWriter(sw));
        cr.accept(cv,
                new Attribute[] { new Comment(), new CodeComment() },
                ClassReader.EXPAND_FRAMES);

        String generated = sw.toString();
View Full Code Here


            trace(generated);
            throw ex;
        }

        ClassWriter cw = new ClassWriter(0);
        cr.accept(new ClassAdapter(cw) {
            @Override
            public MethodVisitor visitMethod(
                final int access,
                final String name,
                final String desc,
View Full Code Here

    }

    @Override
    public void test() throws Exception {
        ClassReader cr = new ClassReader(is);
        cr.accept(new SerialVersionUIDAdder(new EmptyVisitor()), 0);
    }
}
View Full Code Here

    }

    @Override
    public void test() throws Exception {
        ClassReader cr = new ClassReader(is);
        cr.accept(new ClassAdapter(new ClassWriter(0)) {
            @Override
            public MethodVisitor visitMethod(
                final int access,
                final String name,
                final String desc,
View Full Code Here

        SAXTransformerFactory saxtf = (SAXTransformerFactory) TransformerFactory.newInstance();
        TransformerHandler handler = saxtf.newTransformerHandler();
        handler.setResult(new SAXResult(new ASMContentHandler(cw)));
        handler.startDocument();
        cr.accept(new SAXClassAdapter(handler, false), 0);
        handler.endDocument();
       
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        bos.write(cw.toByteArray());
View Full Code Here

       
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        bos.write(cw.toByteArray());

        ClassWriter cw2 = new ClassWriter(0);
        cr.accept(cw2, new Attribute[] { new Attribute("Comment") {
            @Override
            protected Attribute read(
                final ClassReader cr,
                final int off,
                final int len,
View Full Code Here

    @Override
    public void test() throws Exception {
        ClassReader cr = new ClassReader(is);
        ClassWriter cw = new ClassWriter(0);
        cr.accept(new ClassAdapter(cw) {
            @Override
            public MethodVisitor visitMethod(
                final int access,
                final String name,
                final String desc,
View Full Code Here

    @Override
    public void test() throws Exception {
        ClassReader cr = new ClassReader(is);
        ClassWriter cw1 = new ClassWriter(0);
        ClassWriter cw2 = new ClassWriter(0);
        cr.accept(new ReferenceClassAdapter(cw1), ClassReader.EXPAND_FRAMES);
        cr.accept(new AdviceClassAdapter(cw2), ClassReader.EXPAND_FRAMES);
        assertEquals(new ClassReader(cw1.toByteArray()),
                new ClassReader(cw2.toByteArray()));
    }
View Full Code Here

    @Override
    public void test() throws Exception {
        ClassReader cr = new ClassReader(is);
        ClassNode cn = new ClassNode();
        cr.accept(cn, 0);
        // clone instructions for testing clone methods
        for (int i = 0; i < cn.methods.size(); ++i) {
            MethodNode mn = cn.methods.get(i);
            Iterator<AbstractInsnNode> it = mn.instructions.iterator();
            Map<LabelNode, LabelNode> m = new HashMap<LabelNode, LabelNode>() {
View Full Code Here

    public void test() throws Exception {
        ClassReader cr = new ClassReader(is);
        ClassWriter cw1 = new ClassWriter(0);
        ClassWriter cw2 = new ClassWriter(0);
        cr.accept(new ReferenceClassAdapter(cw1), ClassReader.EXPAND_FRAMES);
        cr.accept(new AdviceClassAdapter(cw2), ClassReader.EXPAND_FRAMES);
        assertEquals(new ClassReader(cw1.toByteArray()),
                new ClassReader(cw2.toByteArray()));
    }

    static class ReferenceClassAdapter extends ClassAdapter {
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.