Reputation: 11595
I am looking for a tool (or chain of tools) that can parse a .class files to a Java object. Something like :
JavaClass parsed = myTool.parse("/some_folder/SomeClassFile.class");
The parsed object would have methods like :
List<JavaMethod> methods = parsed.getMethods();
List<JavaInterface> interfaces = parsed.getImplementedInterfaces();
List<JavaMethod> calls = someMethod.getCalls();
My constraints are :
Of course I can do some coding, so for example if the output is xml it's ok.
So here are the options I have found so far - none being satisfying as it is :
So here is where I am now ! Thanks in advance for your help !
Upvotes: 4
Views: 920
Reputation: 873
I made some test for JBBP to parse java class, take a look at it, may be it will be useful for you https://github.com/raydac/java-binary-block-parser/blob/master/src/test/java/com/igormaznitsa/jbbp/it/ClassParsingTest.java
Upvotes: 0
Reputation: 39461
I'd recommend ASM. From what I've seen, it's by far the most popular Java bytecode library, and yes, it is still maintained. At time of writing, it looks like the most recent change was 41 days ago. So it's not constantly churning but it's not like it's abandoned either. And with such a commonly used library, support should be easy to find.
Upvotes: 3