sofya.apps.dejavu
Class InputParser

java.lang.Object
  extended by sofya.apps.dejavu.InputParser

public final class InputParser
extends java.lang.Object

This class performs basic validation of the input files supplied to DejaVu. It is also responsible for correlating classes and methods between the two versions (P and P') for comparison, based on class and method names.

Version:
05/13/2005
Author:
cs562-03 dev team., Alex Kinneer

Constructor Summary
InputParser(java.lang.String oldProgFile, java.lang.String newProgFile, java.lang.String oldTag, java.lang.String newTag, java.lang.Class graphLoaderType)
          Standard constructor, the validation of the inputs is performed as part of object construction, after which the object is effectively a data object from which information can be retrieved.
 
Method Summary
 ClassPair[] getClassPairs()
          Gets the list of matched classes.
 MethodPair[] getMethods(ClassPair clazz)
          Builds the list of method pairings containing information about the methods that must be traversed for the specified class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputParser

public InputParser(java.lang.String oldProgFile,
                   java.lang.String newProgFile,
                   java.lang.String oldTag,
                   java.lang.String newTag,
                   java.lang.Class graphLoaderType)
            throws BadFileFormatException,
                   java.io.IOException
Standard constructor, the validation of the inputs is performed as part of object construction, after which the object is effectively a data object from which information can be retrieved.

Parameters:
oldProgFile - 'Prog' file for old version of program.
newProgFile - 'Prog' file for new version of program.
oldTag - Database tag for old version of program.
newTag - Database tag for new version of program.
graphLoaderType - Class of graph loader to be used to retrieve graphs for the classes specified in the 'prog' files.
Throws:
BadFileFormatException - If a database file is found to be corrupted while attempting jnput validation.
java.io.IOException - For any other IO error reading files required to perform validation.
Method Detail

getClassPairs

public ClassPair[] getClassPairs()
Gets the list of matched classes.

Returns:
The list of matching classes, as an array.

getMethods

public MethodPair[] getMethods(ClassPair clazz)
                        throws java.io.FileNotFoundException,
                               EmptyFileException,
                               BadFileFormatException,
                               MethodNotFoundException,
                               java.io.IOException
Builds the list of method pairings containing information about the methods that must be traversed for the specified class.

Parameters:
clazz - Information about the class for which method pairings should be returned.
Returns:
A list of MethodPair objects to be traversed by the graph traverser.
Throws:
java.io.FileNotFoundException - If a database file required to retrieve information about the methods cannot be found.
EmptyFileException - If a database file required to retrieve information about the methods contains no data.
BadFileFormatException - If a database file required to retrieve information about the methods is corrupted.
MethodNotFoundException - If an inconsistency between database files for the two versions of the program prevent information from being retrieved about a method.
java.io.IOException - For any IO error that prevents reading of a database file required to retrieve information about the methods.