Package org.joinfaces.tools
Class ScanResultHandler
java.lang.Object
org.joinfaces.tools.ScanResultHandler
- Direct Known Subclasses:
FacesAnnotationProviderHandler,RewriteAnnotationProviderHandler,ServletContainerInitializerHandler
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidHandles theScanResultproduced byClasspathScanner.protected voidwriteClassList(File file, Collection<String> classNames) Helper method which writes a list of class names to the given file.protected voidwriteClassMap(File file, Map<String, ? extends Collection<String>> classMap) Helper method which writes a map of class names to the given file.
-
Constructor Details
-
ScanResultHandler
public ScanResultHandler()
-
-
Method Details
-
handle
public abstract void handle(io.github.classgraph.ScanResult scanResult, File classpathRoot) throws IOException Handles theScanResultproduced byClasspathScanner.- 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
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 IOExceptionHelper 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.
-