org.jfree.xml.generator

## Class JavaSourceCollector

- java.lang.Object
- - org.jfree.xml.generator.JavaSourceCollector

- All Implemented Interfaces:
    SourceCollector

      public class JavaSourceCollector
      extends java.lang.Object
      implements SourceCollector

  The class collects all class-files and loads the class objects named by these files.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaSourceCollector(java.io.File startDirectory)` Creates a new source collector.
    `JavaSourceCollector(java.io.File startDirectory, java.lang.String packageName)` Creates a new source collector.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addIgnoredBaseClass(java.lang.Class baseClass)` Adds a class to the list of ignored base classes.
    `void` | `addIgnoredBaseClass(java.lang.String baseClass)` Adds a base class that should be ignored.
    `void` | `addIgnoredPackage(java.lang.String pkg)` Adds a package that should be ignored.
    `protected java.lang.String` | `buildJavaName(java.lang.String packageName, java.lang.String newPackage)` Creates a fully qualified Java class or package name.
    `void` | `collectFiles()` Collects the files/classes.
    `protected void` | `collectFiles(java.io.File directory, java.lang.String packageName)` Collects the files/classes.
    `java.lang.Class[]` | `getClasses()` Returns the list of classes as an array.
    `protected boolean` | `isIgnoredBaseClass(java.lang.Class c)` Returns `true` if the named class is being ignored (because it is a descendant of an ignored base class), and `false` otherwise.
    `protected boolean` | `isIgnoredPackage(java.lang.String classname)` Returns `true` if the named class is being ignored (because of the package that it belongs to), and `false` otherwise.
    `protected java.lang.Class` | `loadClass(java.lang.String name)` Loads a class by its fully qualified name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaSourceCollector

          public JavaSourceCollector(java.io.File startDirectory)

      Creates a new source collector.
      Parameters:
        `startDirectory` - the start directory.

    - #### JavaSourceCollector

          public JavaSourceCollector(java.io.File startDirectory,
                             java.lang.String packageName)

      Creates a new source collector.
      Parameters:
        `startDirectory` - the base directory.
        `packageName` - the base package name.

  - ### Method Detail

    - #### addIgnoredPackage

          public void addIgnoredPackage(java.lang.String pkg)

      Adds a package that should be ignored.
      Parameters:
        `pkg` - the package name.

    - #### addIgnoredBaseClass

          public void addIgnoredBaseClass(java.lang.String baseClass)

      Adds a base class that should be ignored.
      Parameters:
        `baseClass` - the base class name.

    - #### addIgnoredBaseClass

          public void addIgnoredBaseClass(java.lang.Class baseClass)

      Adds a class to the list of ignored base classes.
      Parameters:
        `baseClass` - the class.

    - #### isIgnoredPackage

          protected boolean isIgnoredPackage(java.lang.String classname)

      Returns `true` if the named class is being ignored (because of the package that it belongs to), and `false` otherwise.
      Parameters:
        `classname` - the name of the class to test.
      Returns:
        A boolean.

    - #### isIgnoredBaseClass

          protected boolean isIgnoredBaseClass(java.lang.Class c)

      Returns `true` if the named class is being ignored (because it is a descendant of an ignored base class), and `false` otherwise.
      Parameters:
        `c` - the class name.
      Returns:
        A boolean.

    - #### collectFiles

          public void collectFiles()

      Collects the files/classes.

    - #### collectFiles

          protected void collectFiles(java.io.File directory,
                          java.lang.String packageName)

      Collects the files/classes.
      Parameters:
        `directory` - the starting directory.
        `packageName` - the initial package name.

    - #### loadClass

          protected java.lang.Class loadClass(java.lang.String name)

      Loads a class by its fully qualified name.
      Parameters:
        `name` - the class name.
      Returns:
        The class (or `null` if there was a problem loading the class).

    - #### buildJavaName

          protected java.lang.String buildJavaName(java.lang.String packageName,
                                       java.lang.String newPackage)

      Creates a fully qualified Java class or package name.
      Parameters:
        `packageName` - the base package name.
        `newPackage` - the class/package name.
      Returns:
        The fully qualified package/class name.

    - #### getClasses

          public java.lang.Class[] getClasses()

      Returns the list of classes as an array.
      Specified by:
        `getClasses` in interface `SourceCollector`
      Returns:
        The list of classes.