Class ClassPathScanner


  • public class ClassPathScanner
    extends Object
    Class path scanner designed to be used with Guice. This provides a way for modules to request the bindings they need by scanning the class path.
    • Constructor Detail

      • ClassPathScanner

        public ClassPathScanner​(String prefix)
        Create a class path scanner, scanning packages with the given prefix for @Singleton annotated classes.
        Parameters:
        prefix - The package prefix.
    • Method Detail

      • bindAllSingletons

        public void bindAllSingletons​(String prefix,
                                      BiConsumer<Class,​Class> binder,
                                      Consumer<Class> singletonConsumer)
        Binds all Singleton annotated classes discovered by scanning the class path to all their interfaces.
        Parameters:
        prefix - the package prefix of Singleton implementations to consider
        binder - The binder (modeled as a generic consumer)