Reading Java text files would be a bad idea, because you would need to implement most of the parts of a fully-fledged Java compiler, starting from reading the files, scanning, will all the lexical analysis and most other things.
It would be much better to use compiled code and perform static analysis of it. It could be dove via Java
reflection. You can start here: Trail: The Reflection API (The Java™ Tutorials)[^].
—SA