File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Traverse and edit Java Files automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Traverse and edit Java Files automatically" Watch "Traverse and edit Java Files automatically" New topic
Author

Traverse and edit Java Files automatically

yusuf Kaplan
Ranch Hand

Joined: Mar 11, 2011
Posts: 58
Hi all,

I need an API for traversing and editing Java files.
For example, I want to programmatically walk through a bunch of Java files in a directory and If I find a specific attribute or method within a Java file, then I want to remove or edit this attribute or method. I dont want to do it with BufferedReader and -Writer. Is there maybe any known libraries to help here?

Cheers,
Y
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3611
    
  14

Why do you want to edit Java files like that?
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2264
    
    3

It is pretty likely that such thing would just cause compile-time errors, since supposedly the files would still be compiled after that...


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Traverse and edit Java Files automatically