I have a Java .class-file. Now I'd like to find out which methods an fields it provides to the outside world.
I'd like to get a list of all methods and fields plus their visibility. The output could be:
1) final static String CONST = "Test"
2) final public void print(String)
3) protected(com.stackoverflow.package) void pprint(String)
Use javap
javap DocFooter.class
To get the static final constants
javap -constants DocFooter.class
Check this out
For every class with in the JVM there is object of the type Class. You can query on this object to get all the info on that particular class.
Class myClass = MyClass.class Method method[] = myClass.getDeclaredMethods();
Refer to Java doc for further info, http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html
If you just want to look at the class content then there are editors like djCompiler etc which does a pretty good job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With