Save This Page
Home » qdox-sources » com.thoughtworks.qdox » [javadoc | source]
com.thoughtworks.qdox
public class: JavaDocBuilder [javadoc | source]
java.lang.Object
   com.thoughtworks.qdox.JavaDocBuilder

All Implemented Interfaces:
    JavaClassCache, Serializable

Simple facade to QDox allowing a source tree to be parsed and the resulting object model navigated.

Example


// -- Create JavaDocBuilder

JavaDocBuilder builder = new JavaDocBuilder();

// -- Add some files

// Reading a single source file.
builder.addSource(new FileReader("MyFile.java"));

// Reading from another kind of input stream.
builder.addSource(new StringReader("package test; public class Hello {}"));

// Adding all .java files in a source tree (recursively).
builder.addSourceTree(new File("mysrcdir"));

// -- Retrieve source files

JavaSource[] source = builder.getSources();

Constructor:
 public JavaDocBuilder() 
 public JavaDocBuilder(DocletTagFactory docletTagFactory) 
Method from com.thoughtworks.qdox.JavaDocBuilder Summary:
addSource,   addSource,   addSource,   addSource,   addSourceTree,   getClassByName,   getClassLibrary,   getClasses,   getSources,   load,   save,   search,   setDebugLexer,   setDebugParser,   setEncoding
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.thoughtworks.qdox.JavaDocBuilder Detail:
 public JavaSource addSource(Reader reader) 
 public JavaSource addSource(File file) throws IOException, FileNotFoundException 
 public JavaSource addSource(URL url) throws IOException, FileNotFoundException 
 public JavaSource addSource(Reader reader,
    String sourceInfo) 
 public  void addSourceTree(File file) 
 public JavaClass getClassByName(String name) 
 public ClassLibrary getClassLibrary() 
 public JavaClass[] getClasses() 
    Returns all the classes found in all the sources, including inner classes and "extra" classes (multiple outer classes defined in the same source file).
 public JavaSource[] getSources() 
 public static JavaDocBuilder load(File file) throws IOException 
    Note that after loading JavaDocBuilder classloaders need to be re-added.
 public  void save(File file) throws IOException 
 public List search(Searcher searcher) 
 public  void setDebugLexer(boolean debugLexer) 
    Forces QDox to dump tokens returned from lexer to System.err.
 public  void setDebugParser(boolean debugParser) 
    Forces QDox to dump parser states to System.out.
 public  void setEncoding(String encoding)