This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes question about : adding a method to a valid java source file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "question about : adding a method to a valid java source file" Watch "question about : adding a method to a valid java source file" New topic
Author

question about : adding a method to a valid java source file

Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 194
Currently I'm working on a new open source project that needs the following feature : add a property, method or class to a given valid java source file in a neat way.

This should be done before and there should be dozens of projects that use this feature. But each and every project, like elide and qdox, have some problems with preserving comments. Therefore I got some doubts about how easy this is to solve.

Therefore I'm posting this question before spending a week or so trying to solve this problem. Does anyone like to share some knowledge with me about this topic. Is there a well known project that has got this feature and could you give me some example code? Is it straightforward to solve this problem with projects like jjtree, javacc, antlr, ... Could you give me some example code or references.

The result sould be something like :



Thnx in advance!!
[ September 29, 2004: Message edited by: Arnold Reuser ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You might consider writing your project on the open-source Eclipse platform. Eclipse's "JDT" Java development environment is built on exactly the sort of framework you need.


[Jess in Action][AskingGoodQuestions]
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 194
Currently I've implemented the solution with JDT 3.0 in a succesful way.
Not all features of JDT are implemented and a redesign can make it even more powerful, but it suits its purpose.
[ October 07, 2004: Message edited by: Arnold Reuser ]
 
 
subject: question about : adding a method to a valid java source file
 
Similar Threads
protected access modifier and subclass
Roberts/Heller/Ernest Ch. 6 questions 1 & 2 (pp. 192-3)
Urgent help needed
java
Architectural Advice