Class ScanResultHandler

    • Constructor Detail

      • ScanResultHandler

        public ScanResultHandler()
    • Method Detail

      • handle

        public abstract void handle​(io.github.classgraph.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.