Class ModuleAutoFinder

    • Field Detail

      • accept

        protected final org.apache.commons.collections15.Transformer<Class<? extends com.google.inject.Module>,​Boolean> accept
      • ignore

        protected final org.apache.commons.collections15.Transformer<Class<? extends com.google.inject.Module>,​Boolean> ignore
    • Constructor Detail

      • ModuleAutoFinder

        @Inject
        public ModuleAutoFinder()
        Constructs a ModuleAutoFinder.
      • ModuleAutoFinder

        public ModuleAutoFinder​(org.apache.commons.collections15.Transformer<Class<? extends com.google.inject.Module>,​Boolean> accept,
                                org.apache.commons.collections15.Transformer<Class<? extends com.google.inject.Module>,​Boolean> ignore,
                                Collection<String> directories)
        Constructs a ModuleAutoFinder.
        Parameters:
        accept - the accept transformer
        ignore - the ignore transformer
        directories - additional directories for the classpath
    • Method Detail

      • getModules

        public Collection<Class<? extends com.google.inject.Module>> getModules()
        Description copied from interface: ModuleList
        Returns the classes of all modules.
        Specified by:
        getModules in interface ModuleList
        Returns:
        the classes of all modules
      • getAll

        protected Collection<Class<? extends com.google.inject.Module>> getAll()
        Returns all not abstract classes that implement PropertyModule.
        Returns:
        all property modules
      • isJar

        protected boolean isJar​(File file)
        Returns true if the file is a Jar archive.
        Parameters:
        file - the tested file
        Returns:
        true if the file is a Jar archive
      • getAllClasses

        protected List<Class<?>> getAllClasses​(File directory)
        Retrieves all Classes from one directory.
        Parameters:
        directory - the directory
        Returns:
        all classes in a list
      • getAllClasses

        protected List<Class<?>> getAllClasses​(File root,
                                               File file)
        Recursive methods searching for classes in a root directory.
        Parameters:
        root - the root directory
        file - the current file
        Returns:
        the list of all found classes
      • getAllClasses

        protected List<Class<?>> getAllClasses​(ZipFile zipFile)
        Retrieves all Classes from a ZipFile (Jar archive).
        Parameters:
        zipFile - the Jar archive
        Returns:
        the list of all classes