Class ScanResultHandler

java.lang.Object
org.joinfaces.tools.ScanResultHandler
Direct Known Subclasses:
FacesAnnotationProviderHandler, RewriteAnnotationProviderHandler, ServletContainerInitializerHandler

public abstract class ScanResultHandler extends Object
Abstract base class for classpath scans done at build time.

The actual classpath scan is only done once by ClasspathScanner. The ScanResult is then passed to implementations of this class, which can look for classes of their interest and can produce corresponding result files to be read at runtime.

See Also:
  • Constructor Details

    • ScanResultHandler

      public ScanResultHandler()
  • Method Details

    • handle

      public abstract void handle(ScanResult scanResult, File classpathRoot) throws IOException
      Handles the ScanResult produced by ClasspathScanner.
      Parameters:
      scanResult - The result of the classpath scan.
      classpathRoot - The base dir for result files. This is usually a classpath root directory.
      Throws:
      IOException - when the result file(s) could not be written.
    • writeClassList

      protected void writeClassList(File file, Collection<String> classNames) throws IOException
      Helper method which writes a list of class names to the given file.
      Parameters:
      file - The target file in which the class names should be written.
      classNames - The class names which should be written in the target file.
      Throws:
      IOException - when the class names could not be written to the target file.
    • writeClassMap

      protected void writeClassMap(File file, Map<String,? extends Collection<String>> classMap) throws IOException
      Helper method which writes a map of class names to the given file.
      Parameters:
      file - The target file in which the class names should be written.
      classMap - The class names which should be written in the target file.
      Throws:
      IOException - when the class names could not be written to the target file.