Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.displaytag.test
Class ClassFinder  view ClassFinder download ClassFinder.java

java.lang.Object
  extended byorg.displaytag.test.ClassFinder

class ClassFinder
extends java.lang.Object

This class is responsible for searching a directory for class files. It builds a list of fully qualified class names from the class files in the directory tree.

Version:
$Revision: 902 $ ($Author: fgiust $)

Field Summary
private  java.util.List classNameList
          List of found classes (names).
private  int startPackageLength
          length of the base package String.
 
Constructor Summary
ClassFinder(java.io.File classPathRoot, java.lang.String packageRoot)
          Construct the class finder and locate all the classes in the directory structured pointed to by classPathRoot.
 
Method Summary
private  java.lang.String computeClassName(java.io.File file)
          Given a file name, guess the fully qualified class name.
private  void findAndStoreTestClasses(java.io.File currentDirectory)
          This method does all the work.
 java.util.Iterator getClasses()
          Return the found classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classNameList

private java.util.List classNameList
List of found classes (names).


startPackageLength

private int startPackageLength
length of the base package String.

Constructor Detail

ClassFinder

public ClassFinder(java.io.File classPathRoot,
                   java.lang.String packageRoot)
Construct the class finder and locate all the classes in the directory structured pointed to by classPathRoot. Only classes in the package packageRoot are considered.

Method Detail

computeClassName

private java.lang.String computeClassName(java.io.File file)
Given a file name, guess the fully qualified class name.


findAndStoreTestClasses

private void findAndStoreTestClasses(java.io.File currentDirectory)
This method does all the work. It runs down the directory structure looking for java classes.


getClasses

public java.util.Iterator getClasses()
Return the found classes.