Class OfficeFloorClassPathScanner


  • public class OfficeFloorClassPathScanner
    extends java.lang.Object
    Class path scanner to aid discovering resources.
    Author:
    Daniel Sagenschneider
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> scan​(java.lang.String packageName)
      Scans the package for Class path entries.
      java.util.Set<java.lang.String> scanClasses​(java.lang.String packageName)
      Scans the package for just Class fully qualified names.
      static java.lang.String translatePackageToPath​(java.lang.String packageName)
      Convenience method to translates the Package name to class path entry path.
      static java.lang.String translateResourceUrlToFilePath​(java.net.URL resourceUrl)
      Translates the resource URL to the JAR file path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OfficeFloorClassPathScanner

        public OfficeFloorClassPathScanner​(SourceContext context)
        Instantiate.
        Parameters:
        context - SourceContext.
    • Method Detail

      • translatePackageToPath

        public static java.lang.String translatePackageToPath​(java.lang.String packageName)
        Convenience method to translates the Package name to class path entry path.
        Parameters:
        packageName - Package name.
        Returns:
        Class path entry path for Package.
      • translateResourceUrlToFilePath

        public static java.lang.String translateResourceUrlToFilePath​(java.net.URL resourceUrl)
        Translates the resource URL to the JAR file path.
        Parameters:
        resourceUrl - Resource URL.
        Returns:
        File path.
      • scan

        public java.util.Set<java.lang.String> scan​(java.lang.String packageName)
                                             throws java.io.IOException
        Scans the package for Class path entries.
        Parameters:
        packageName - Package name.
        Returns:
        Class path entries for the package.
        Throws:
        java.io.IOException - If fails to scan the Class path.
      • scanClasses

        public java.util.Set<java.lang.String> scanClasses​(java.lang.String packageName)
                                                    throws java.io.IOException
        Scans the package for just Class fully qualified names.
        Parameters:
        packageName - Package name.
        Returns:
        Fully qualified Class names for the package.
        Throws:
        java.io.IOException - If fails to scan the Class path.