Package org.joinfaces.tools
Class ScanResultHandler
- java.lang.Object
-
- org.joinfaces.tools.ScanResultHandler
-
- Direct Known Subclasses:
MyFacesAnnotationProviderHandler
,RewriteAnnotationProviderHandler
,ServletContainerInitializerHandler
public abstract class ScanResultHandler extends java.lang.Object
Abstract base class for classpath scans done at build time.The actual classpath scan is only done once by
ClasspathScanner
. TheScanResult
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:
ClasspathScanner
-
-
Constructor Summary
Constructors Constructor Description ScanResultHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
handle(io.github.classgraph.ScanResult scanResult, java.io.File classpathRoot)
Handles theScanResult
produced byClasspathScanner
.protected void
writeClassList(java.io.File file, java.util.Collection<java.lang.String> classNames)
Helper method which writes a list of class names to the given file.protected void
writeClassMap(java.io.File file, java.util.Map<java.lang.String,? extends java.util.Collection<java.lang.String>> classMap)
Helper method which writes a map of class names to the given file.
-
-
-
Method Detail
-
handle
public abstract void handle(io.github.classgraph.ScanResult scanResult, java.io.File classpathRoot) throws java.io.IOException
Handles theScanResult
produced byClasspathScanner
.- Parameters:
scanResult
- The result of the classpath scan.classpathRoot
- The base dir for result files. This is usually a classpath root directory.- Throws:
java.io.IOException
- when the result file(s) could not be written.
-
writeClassList
protected void writeClassList(java.io.File file, java.util.Collection<java.lang.String> classNames) throws java.io.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:
java.io.IOException
- when the class names could not be written to the target file.
-
writeClassMap
protected void writeClassMap(java.io.File file, java.util.Map<java.lang.String,? extends java.util.Collection<java.lang.String>> classMap) throws java.io.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:
java.io.IOException
- when the class names could not be written to the target file.
-
-