Search in sources :

Example 1 with TraceClassVisitor

use of org.jetbrains.org.objectweb.asm.util.TraceClassVisitor in project intellij-community by JetBrains.

the class ByteCodeViewerManager method processClassFile.

private static String processClassFile(byte[] bytes) {
    final ClassReader classReader = new ClassReader(bytes);
    final StringWriter writer = new StringWriter();
    final PrintWriter printWriter = new PrintWriter(writer);
    try {
        classReader.accept(new TraceClassVisitor(null, new Textifier(), printWriter), 0);
    } finally {
        printWriter.close();
    }
    return writer.toString();
}
Also used : TraceClassVisitor(org.jetbrains.org.objectweb.asm.util.TraceClassVisitor) StringWriter(java.io.StringWriter) ClassReader(org.jetbrains.org.objectweb.asm.ClassReader) Textifier(org.jetbrains.org.objectweb.asm.util.Textifier) PrintWriter(java.io.PrintWriter)

Aggregations

PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 ClassReader (org.jetbrains.org.objectweb.asm.ClassReader)1 Textifier (org.jetbrains.org.objectweb.asm.util.Textifier)1 TraceClassVisitor (org.jetbrains.org.objectweb.asm.util.TraceClassVisitor)1