Track public classes, interfaces and methods by ID

Hi All,
I'm wondering whether there is a tool to assign a unique ID to classes, interfaces and methods (eg. within Javadoc) and track these IDs.
The reason I'd need such a feature is that I'd like to do requirements tracking in an easy but complete way. I have a document containing functional specifications (with IDs) and on the other side there is the source code; where the javadoc of the public methods and classes is my software specification. What I now want to do is make a link between the IDs in the functional spec to the IDs in the sofware spec (ie. the source code).
Does anybody know of such a tool (commercial or not)?
Thanks,
Daniel

I'm a bit confused as to whether or not I understand you correctly. Please tell me if the following pseudocode is somewhat like the solution you are looking for:
class MethodFunctionality {
   private Class methodClass;
   private String methodSignature;
   private List methodFunctions;
    *   Returns true if the method is used for the specified
    *   requirement, false otherwise.
   public boolean fulfills(int requirementId) {
      if methodFunctions.contains(requirementId)
         return true;
      else
         return false;
   public String getMethodSignature() {
      return this.methodSingature;
   public Class getMethodClass() {
      return this.methodClass;
    *   Returns an array with IDs of each functional
    *   requirement covered by the method.
   public int[] getCoverage() {
      return this.methodFunctions;
class ClassFunctionality {
   private Map methodDetails;
   private List classFunctions;
   public MethodFunctionality getMethodDetails(String methodSignature) {
      return (MethodFunctionality) this.methodDetails.get(methodSignature);
    *   Returns true if the class is used for the specified
    *   requirement, false otherwise.
   public boolean fulfills(int requirementId) {
      if classFunctions.contains(requirementId)
         return true;
      else
         return false;
    *   Returns an array with IDs of each functional
    *   requirement covered by the class.
   public int[] getCoverage() {
      return this.classFunctions;
}Mapping classes and methods to functionality like this would both allow you to query each class and method for all the functional requirements they claim to cover and would allow you to collect all classes and methods involved for a particular functional requirement.

Similar Messages

  • Customize class members and methods showed by IDE

    Is anyway to customize the output of the class members and methods show by IDE when you code a class?
    In detail:
    If you have a class A:
    A myClass = new A();
    and you tipe myClass.
    then the IDE show you a list of class members and methods in a Dialog Box....
    can you customize these????????
    I want to set another output for these....
    Thanks!

    That's not the meaning of the question.....
    When someone work with a Java IDE and are editing source, the IDE help you writing code showing you the members and methods of the object that you are working on, like these:
    a.------------------------
    | void setX(int x) |
    | void setY(int y) |
    These information is provided by the IDE. I think that it makes a special type of introspection on classes ..... but a really strong one, because it can access to private members and methods....
    I want to customize these behaviour....... and i want the IDE's show only the strings that i want....
    For exemple:
    a.------------------------
    | to establish X |
    | to establish Y |
    Thanks!

  • Deprecated interfaces and methods

    We have a weblogic time service that utilize a lot of
    deprecated interfaces and methods such as
    ScheduledTriggerDef, TimeServicesDef etc. Although the time
    service runs in the WLS 7, it is a big concern to me
    that it uses so many deprecated interfaces or methods.
    I am just wondering how I can replace them with non-deprecated ones

    Mark,
    I have a question about the API.
    From the documentation and the API docs it is not clear how to schedule
    a callback to be called just once ASAP.
    We use the deprecated Timer service to execute long running operations
    on the Weblogic thread pool and want the operation to execute only once
    and start as soon as there is a thread available.
    It is not clear what will happen in case a task is scheduled to be
    executed only once and the time for that execution has passed ( 5 ms ago).
    I'd appreciate the clarification.
    Thanks,
    Dejan
    Mark Griffith wrote:
    It will run because it is only deprecated. You should at some point
    "rewrite", but the rewrite is not that big of a deal. There maybe some
    slight differences in timers, since we moved to jmx interfacs, but the
    scemantics should be very very close.
    Attached is an example that will run in the 8.1 sample environment.
    cd to $WLS_HOME
    (On my box it is /bea/wls81/weblogic81/)
    cd samples/domains/examples/
    setExamplesEnv.sh
    cd ../../server/examples/src/examples
    ../examples/src/examples 201$ pwd
    C:/bea/wls81/weblogic81/samples/server/examples/src/examples
    cp jmxTimerEar.zip .
    jar xvf jmxTimerEar.zip
    cd jmxTimerEar
    ant
    And it should build for you.
    Cheers
    mbg
    "Eric Sundberg" <[email protected]> wrote in message
    news:[email protected]..
    We have a weblogic time service that utilize a lot of
    deprecated interfaces and methods such as
    ScheduledTriggerDef, TimeServicesDef etc. Although the time
    service runs in the WLS 7, it is a big concern to me
    that it uses so many deprecated interfaces or methods.
    I am just wondering how I can replace them with non-deprecated ones

  • Hidding java class field and methods

    Hi,
    I'm developing an API and I want to know if there's any way to hide all private class, field and methods when exploring the JAR from eclipse or another IDE. In [this capture|http://i8.photobucket.com/albums/a32/darkskimmer/Sinttulo-1-2.jpg] I can see "extra-information" like return type of private methods, etc. I want to keep this in secret...
    Cheers!
    P.S: I have to improve my english skills, I know... :)

    darkskimmer wrote:
    I'm developing an API and I want to know if there's any way to hide all private class, field and methods when exploring the JAR from eclipse or another IDE. Since the JVM has to be able to see them to access/execute them and and anything it can do you can do then you can't hide them.

  • Interfaces and methods of Object class

    JSL 2.0 states the following
    If an interface has no direct superinterfaces, then the interface implicitly
    declares a public abstract member method m with signature s, return type r,
    and throws clause t corresponding to each public instance method m with
    signature s, return type r, and throws clause t declared in Object, unless a
    method with the same signature, same return type, and a compatible throws
    clause is explicitly declared by the interface.
    But the following codes produces empty output
    package test;
    import java.lang.reflect.Method;
    public class TestIterface {
        public static void main(String [] args){
            Method [] methods=Y.class.getMethods();
            for(int i=0, n=methods.length;i<n;i++)
                System.out.println(methods);
    interface Y{
    What are the reasons of such behaviour?

    then the interface implicitly declares a public abstract member method
    "Implicit" means that it's implied that the interface declares those methods; unlike java.lang.Object, there is no interface from which all other interfaces descend. All interfaces at the "top" of the inheritance hierarchy are implied to expose at least the same methods as Object.
    Hope this helps...

  • Abstract class, Interface and two models issue

    Hi!
    I will post my code and then ask the question (text between code snippets is bold, so you don't miss it, it's not shouting):
    public class AppScreen extends JFrame
                           implements ActionListener {
      private MemoryTableModel model;
      public AppScreen() {
        this.model = new MemoryTableModel();
           //code
      public void actionPerformed(ActionEvent actEvt) {
          if(table.getSelectedRow() != -1) {
            model.deleteRow(table.getSelectedRow());
          else {
            ErrDialog.noRowErr();
      public MemoryTableModel getModel() {
        return model;
    public class MemoryTableModel extends BasicTableModel
                                  implements MemoryTableInterface {
      public MemoryTableModel() {
        //code
      public synchronized void insertRow(String file, String time) {
        //code
      public synchronized void editRow(int selectedRow, String file, String time) {
        //code
    public synchronized void deleteRow(int selectedRow) {
        //code
    public abstract class BasicTableModel extends AbstractTableModel {
      private final String FILE_COLUMN = "Executable file";
      private final String TIME_COLUMN = "Time";
      protected String[] columnNames   = new String[2];
      protected List<RowRecord> data   = new ArrayList<RowRecord>();
      BasicTableModel() {
        //code
      public int getColumnCount() {
        //code
      public int getRowCount() {
        //code
      public String getValueAt(int row, int col) {
        //code
      public Class<? extends String> getColumnClass(int c) {
        //code
      public String getColumnName(int col) {
        //code
      public List<RowRecord> getData() {
        //code
      public int getTimeColumn() {
        //code
      public int getFileColumn() {
        //code
    public interface MemoryTableInterface {
      public void insertRow(String file, String time);
      public void editRow(int selectedRow, String file, String time);
      public void deleteRow(int selectedRow);
    In this form, everything works fine. But now, I would like to choose between two models at the start, so I thought I would do this:
    public class AppScreen extends JFrame
                           implements ActionListener {
      private BasicTableModel model;
      public AppScreen() {
        if(...) {
          this.model = new MemoryTableModel();
        else {
          this.model = new JDBCTableModel();
    public void actionPerformed(ActionEvent actEvt) {
          if(table.getSelectedRow() != -1) {
            model.deleteRow(table.getSelectedRow());
          else {
            ErrDialog.noRowErr();
      public BasicTableModel getModel() {
        return model;
    public class JDBCTableModel extends BasicTableModel
                                implements JDBCTableInterface {
      public JDBCTableModel(Connection conn)
        throws ClassNotFoundException, SQLException {
        //code
      public void insertRow(String file, String time) throws SQLException {
        //code
      public void editRow(int selectedRow, String newFile, String newTime)
          throws SQLException {
        //code
      public void deleteRow(int selectedRow) throws SQLException {
        //code
    public interface JDBCTableInterface {
      public void insertRow(String file, String time) throws SQLException;
      public void editRow(int selectedRow, String file, String time)
          throws SQLException;
      public void deleteRow(int selectedRow) throws SQLException;
    }But I'm getting error message from AppScreen that method deleteRow(int) is undefined for the type BasicTableModel. I thought if I initialize variable model as some implementation of BasicTableModel, it will be OK. Apparently it's not, so:
    where and what am I missing or
    how can I realize this choosing between two models so I don't have to write "if(model == MemoryModel) else if(model == JDBCModel)" around every method where I have to decide.
    Thanks!

    I would like to have issues interfacing with two classy models, as well. ;-)
    You need to have your BasicTobleModel class implement your JDBCTableInterface interface (even if it doesn't implement those methods itself), if that is how you intend to use that class.
    Edit: Too slow.

  • How to convert a String variable as class name and method name?

    i have two classes
    class Student
    public String insertStudent(String sname)
    { return("Student has been inserted ");     }
    class Teacher
    public String execute(String methodName, String className)
    {  //return statement of the method 'insertStudent' in the class 'Student'; }
    }Now, i have a class with the main method. Here, i would like to call the method *'insertStudent'* of class *'Student'*
    using the method *'execute'* of class *'Teacher',* passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Can anyone please help me out. Thanks
    regards,
    chinglai

    You should have just added that as a comment on your [initial posting|http://forums.sun.com/thread.jspa?threadID=5334953] instead of starting a new thread.
    Now, i have a class with the main method. Here, i would like to call the method 'insertStudent' of class 'Student'using the method 'execute' of class 'Teacher', passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Why oh why? What do you want to achieve?
    Let me tell you: there is a way to do what you try to do, but it's not recommended and should be used only very sparingly. Especially not in anything like your code, that resembles normal business logic (as opposed to an application framework such as Spring, for example).
    Can you explain what exactly you want to do with that? Why should a Teacher be able to call any random method ony any other class. And what good would that do?

  • How to learn technics in wrting class, objects and methods

    Hi ,
    I am new this oops methodology. I know java language but don't know the basics. I mean to say I have no idea how to write classes and methods. I can write one single class with all the methods and I can call that class from an another class but this is not the way... I knew it but I am kinda confuse how to write the well structured oops style classes and methods....
    Can anybody help me please........
    Thanks

    A short simple (overly simple) explanation is that objects are like little machines, which operate independantly from other objects (other little machines). You design an application as a collection of these little machine/objects, interacting with each other. Then you drill down another layer of detail, and design the machines themselves. You do this by defining the classes, which are like blueprints to make a little machine/object.
    In java, this is largely expressed by the interface definition at the higher level, and the class definition at the lower level. The interfaces say how various objects may talk to each other, and the class definitions say how any individual object may talk at all.
    This is a very basic description, and in fact isn't entirely accurate; if they want to lots of people on this forum could pick it apart. But hopefully it gets the idea across. (As my language design prof said, quoting somebody else, "teaching is just a series of lies.")
    There are resources on the web about object-oriented programming, object-oriented design, etc. mutmansky's right, a college course is best, but you can still learn a lot from docs on the web.

  • Interfaces and methods with complex object

    In all the examples I have, the methods of an interface use only basic java datatypes (int, Character, ..)
    I want to pass a Vector that represents a list of objects from one of my own classes to an interface method.
    class Myclass ...
    private String p1;
    private int p2;
    myInterfaceMethod(..., Vector list, ...)
    // list is a vector of Myclass objects
    How do I know about Myclass when implementing the interface and how do I access p1 and p2 ?

    You can use any kind of "complex" object in your interface methods, all of them are objects at last.
    The other question seems to be a misunderstanding of interface implementation. When u "implement" an interface in a class, all that JVM does is to check that you actualy have one method (with code inside its body) for each method you defined previously in the interface.
    Think of an interface as a contract signed by a class. It's forced to implement each method definied in you interface. So, as the method is defined inside the class, you can access any data member of the class without doing anything "special". Do u catch it?

  • Delete Class Objects and methods

    Hi, i have created a class file for a game. Now i have 3 to 4
    games in one Main File. So after playing one game user can choose
    another. Now can anybody tell me how to delete the first class
    Object or methods, which was used in First game. So that i can
    remove the garbage collections from Flash to make it with fast
    process?

    A short simple (overly simple) explanation is that objects are like little machines, which operate independantly from other objects (other little machines). You design an application as a collection of these little machine/objects, interacting with each other. Then you drill down another layer of detail, and design the machines themselves. You do this by defining the classes, which are like blueprints to make a little machine/object.
    In java, this is largely expressed by the interface definition at the higher level, and the class definition at the lower level. The interfaces say how various objects may talk to each other, and the class definitions say how any individual object may talk at all.
    This is a very basic description, and in fact isn't entirely accurate; if they want to lots of people on this forum could pick it apart. But hopefully it gets the idea across. (As my language design prof said, quoting somebody else, "teaching is just a series of lies.")
    There are resources on the web about object-oriented programming, object-oriented design, etc. mutmansky's right, a college course is best, but you can still learn a lot from docs on the web.

  • Error Message like Illegal Start of Type,and Class interface and enum expec

    import java.applet.*;
    import java.awt.*;
    //Inheriting the Applet class with firstApplet class
    public class firstApplet extends Applet{
         private Button reset,submit;
         private TextArea addr;
         private TextField name,addr,sex,mar;
         Panel p=new Panel();
         Choice m_choice = new Choice();
         Label namel=new Label("Name");
         Label addrl=new Label("Address");
         Label sexl=new Label("Sex");
         Label marl=new Label("Maital");
         //In it function
    public void init()
         setLayout(new FlowLayout());
         add(m_choice);
         m_choice.addItem("Select Mode");
         m_choice.addItem("Create");
         m_choice.addItem("Edit");
         m_choice.addItem("Delete");
         m_choice.addItem("Search");
         add(namel);
         name=new TextField(20);
         add(name);
         add(addrl);
         addr=new TextArea(5,20);
         add(addr);
         add(sexl);
         sex=new TextField(10);
         add(sex);
         add(marl);
         mar=new TextField(20);
         add(mar);
         submit =new Button("Submit");
         add(submit);
         reset =new Button("Reset");
         add(reset);
         t=new TextField(30);
         add(t);
    public boolean action(Event e,Object o){
         if (e.target instanceof Button){
                   String s= (String)o;
                   if(s.equals ("Submit"))
                        t.setText("Error Occured While Saving to the database");
                   else if (s.equals("Reset")){
                        name.setText("");
                        addr.setText("");
                        sex.setText("");
                        mar.setText("");
                        t.setText("");}
                   return true;
         else
              return false;
    }I this program while compiling i am getting the above specified.This is the Code i used.At that Bolded else and return false lines are showing as error lines.Why this error is coming?Pls send help me with some hint,Because i am new to Java.

    Be consistent about your placement of {} and use of indentation. Sun's code
    conventions provide an example: http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

  • How to get class name and method name within a class method?

    Hi,
    In a java class, is it possible to get its class name and the class method?
    Please advise.
    Thank you.

    I mean whether there's any built-in command that will
    return the class name instead of code it ourself, for
    easier maintenance.
    Possible?
    this.getClass().getName();

  • Why a public class name and file name same?

    All of us know that, a public class should be declared in a file which has the same name of that class. What is the underlying concept behind this..Can someone give a clear explanation?
    Thanx..
    Sandeep Joseph
    Paragon Solutions
    [email protected]

    Another issue, it was said that the file must be named
    after the class to find the class's code when
    compiling dependent classes. Doesn't this apply to
    non-public classes too (with the dependent class being
    located in the same package)?This applies to all top-level classes ...
    You can define multiple classes in one file though:
    class A {
    class B {
    }It's perfectly valid to have both classes defined in the same file (named A.java if A is the first class to be defined in that file).
    You will get a compiler warning as soon as you reference a non-top-level class from a class that is defined in another file, though.

  • Abstract classes, Interfaces, and concrete classes

    I have another technical interview tomorrow and somehow I keep getting asked the same question and I feel my answer is not really up to par. The question is:
    "What is the advantage of subclassing an abstract class versus concrete class?"
    "What is the difference of using an interface versus an abstract class, which is better to use?"
    For the first question, I usually answer performance is the advantage because you don't have to instantiate the class.
    For the second question, I usually say that you can put implementation in an abstract class and you can't in an interface. I really can't answer the second part to this question.
    Any ideas?

    For the first question, I usually answer performance
    is the advantage because you don't have to instantiate
    the class. Try invoking the class B in the following somewhere in another class.
    abstract class A{
       A(){
          System.out.println("abstract instantiated");
    class B extends A{
      B(){super();}
    }

  • Help with Declaring a Class with a Method and Instantiating an Object

    hello all i am having trouble understanding and completing a lab tutorial again!
    im supposed to compile an run this code then save work to understand how to declare aclass with a method an instantiate an object of the class with the following code
    // Program 1: GradeBook.java
    // Class declaration with one method.
    public class GradeBook
    // display a welcome message to the GradeBook user
    public void displayMessage()
    System.out.println( "Welcome to the Grade Book!" );
    } // end method displayMessage
    } // end class GradeBook
    // Program 2: GradeBookTest4.java
    // Create a GradeBook object and call its displayMessage method.
    public class GradeBookTest
    // main method begins program execution
    public static void main( String args[] )
    // create a GradeBook object and assign it to myGradeBook
    GradeBook myGradeBook = new GradeBook();
    // call myGradeBook's displayMessage method
    myGradeBook.displayMessage();
    } // end main
    } // end class GradeBookTest4
    i saved above code as shown to working directory filename GradeBookTest4.java
    C:\Program Files\Java\jdk1.6.0_11\bin but recieved error message
    C:\Program Files\Java\jdk1.6.0_11\bin>javac GradeBook4a.java GradeBookTest4.java
    GradeBookTest4.java:2: class, interface, or enum expected
    ^
    GradeBookTest4.java:27: reached end of file while parsing
    ^
    2 errors
    can someone tell me where the errors are because for class or interface expected message i found a solution which says 'class? or 'interface' expected is because there is a missing { somewhere much earlier in the code. i dont know what "java:51: reached end of file while parsing " means or what to do to fix ,any ideas a re appreciated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Doesn't solve your problem, but this works for me...
    public class GradeBook
      public void displayMessage() {
        System.out.println( "Welcome to the Grade Book!" );
      public static void main( String args[] ) {
        try {
          GradeBook gradeBook = new GradeBook();
          gradeBook.displayMessage();
        } catch (Exception e) {
          e.printStackTrace();
    }

Maybe you are looking for

  • Hot synch failures

    When I try to Hot synch my Treo 700 I get a message that the operation failured because of a conflict in the installed conduits has been detected.  The example that was cited was between my contacts and my address book which is what is not being back

  • Looking for a new window manager

    Hello all! My first post here and I'd like to share a little discussion. So I have this idea of "perfect desktop" in my mind: - It must be lightweight - Very clean. - No menus - Highly customizable. - Able to run compiz I've come to Enlightenment 17

  • Drag/replace pages from one document to another?

    Hello, I've recently upgraded from Acrobat 7 to 9, and a feature I've used for years (since Acrobat 5) doesn't seem to be there anymore...  I have a product manual I'm editing, and have a couple of replacement pages with new/updated content.  I have

  • Adobe Premiere Pro doesn't recognise Sony camera

    When I connect my Sony DCR-TRV245E Digital8 camcorder using the iLink (IEEE 1394) connection both Adobe Premiere Pro CS4 running under Windows XP Pro 32 bit and Adobe Premiere Pro CS5 running under Windows 7 Pro 64 bit recognise and control the camer

  • Presario C751NR Microphone jack not detected, internal Mic works OK

    I made sure that I have the most current Conexant audio driver installed: http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-64867-1&lc=en&dlc=en&cc=us〈=en&os=2093&product=3646600 When I plug a microphone into the microphone jac