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
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
handle
(ScanResult scanResult, File classpathRoot) Handles theScanResult
produced byClasspathScanner
.protected void
writeClassList
(File file, Collection<String> classNames) Helper method which writes a list of class names to the given file.protected void
writeClassMap
(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
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:
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.
-