Class DirectoryScanner

  • All Implemented Interfaces:
    Scanner<Object>

    public class DirectoryScanner
    extends JavaEEScanner
    implements Scanner<Object>
    Implementation of the Scanner interface for a directory
    Author:
    Jerome Dochez
    • Constructor Detail

      • DirectoryScanner

        public DirectoryScanner()
    • Method Detail

      • process

        public void process​(File directory,
                            Object bundleDesc,
                            ClassLoader classLoader)
                     throws IOException
        Description copied from interface: Scanner
        Scan the archive file and gather a list of classes that should be processed for annotations
        Specified by:
        process in interface Scanner<Object>
        Parameters:
        directory - the archive file for scanning
        bundleDesc - the bundle descriptor associated with this archive
        classLoader - the classloader used to scan the annotation
        Throws:
        IOException
      • getEntries

        protected Set<String> getEntries()
      • getClassLoader

        public ClassLoader getClassLoader()
        Description copied from interface: Scanner
        Returns a ClassLoader capable of loading classes from the underlying medium
        Specified by:
        getClassLoader in interface Scanner<Object>
        Returns:
        a class loader capable of loading the classes
      • getElements

        public Set<Class> getElements()
        Description copied from interface: Scanner
        Return a complete set of classes available from this location.
        Specified by:
        getElements in interface Scanner<Object>
        Returns:
        the complete set of classes
      • getElements

        public Set<Class> getElements​(Set<String> classNames)
        Description copied from interface: Scanner
        Return a class instance available from this location from class name.
        Specified by:
        getElements in interface Scanner<Object>
        Parameters:
        classNames - the list of class name
        Returns:
        the set of classes for given names