I'm creating a program in java that need to read an external source java file.
My fist approach is to read that file as plain text. But as I want to extract all the information from that java source file, I'm applying regular expresions find the class name, extends, implements, attribute names/classes etc.
I'm wondering if there is a more direct way as I have the feeling I'm reinventing the wheel. I know it is possible to get all the information by using reflection with Class.forName. But it is not possible in this case, isn't it? As it is an external java source file so not part of the source code of my program.
Any idea?
Aucun commentaire:
Enregistrer un commentaire