Class DependencyScannerRegistry

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addExcludeListPattern​(java.lang.String pattern)
      Add pattern to the exclude list.
      static void addExcludeListPatterns​(java.util.List<java.lang.String> list)
      Add patterns to the exclude list.
      static void addScanner​(java.lang.String fileExtension, IDependencyScanner scanner)
      Adds an instance of IDependencyScanner to the registry
      static void clear()
      Clear the static variables created by this class and remove all default filetype associations.
      static java.util.List<java.lang.String> getExcludeList()
      Get excluded file patterns.
      static IDependencyScanner getScanner​(java.lang.String filepath)
      Returns the instance of IDependencyScanner registered for this file's file extension or the default scanner if no scanner is registered to the file extension.
      static java.util.List<java.lang.String> listFileExtensions()  
      static void removeScanner​(java.lang.String fileExtension)
      Removes a scanner from the registry
      static void setDefaultScanner​(IDependencyScanner scanner)
      Sets the default scanner returned by getScanner() when no scanner is defined.
      static void setExcludeList​(java.util.List<java.lang.String> list)
      Set the exclude list.
      static void staticReset()
      Resets the static variables created by this class and sets default filetype associations.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setDefaultScanner

        public static void setDefaultScanner​(IDependencyScanner scanner)
        Sets the default scanner returned by getScanner() when no scanner is defined.
        Parameters:
        scanner - A scanner object
      • getScanner

        public static IDependencyScanner getScanner​(java.lang.String filepath)
        Returns the instance of IDependencyScanner registered for this file's file extension or the default scanner if no scanner is registered to the file extension. If the filepath matches a pattern in the excluded files list, getScanner() returns null. The default scanner is DummyScanner but can be overridden using setDefaultScanner. If no '.' is found in the filepath, then the string is assumed to be a file extension.
        Parameters:
        filepath - - the path of the file that needs to be scanned or a file extension used to register a scanner
        Returns:
        the matched, or new, IDependencyScanner, or null if the filepath is on the Exclude List.
      • addScanner

        public static void addScanner​(java.lang.String fileExtension,
                                      IDependencyScanner scanner)
        Adds an instance of IDependencyScanner to the registry
        Parameters:
        fileExtension - - the file extension used to register the scanner. Example 'cob'
        scanner - - An instance of IDependencyScanner
      • removeScanner

        public static void removeScanner​(java.lang.String fileExtension)
        Removes a scanner from the registry
        Parameters:
        fileExtension - - the file extension used to register the scanner. Example 'cob'
      • listFileExtensions

        public static java.util.List<java.lang.String> listFileExtensions()
        Returns:
        A list of file extensions which have a default scanner defined.
      • addExcludeListPatterns

        public static void addExcludeListPatterns​(java.util.List<java.lang.String> list)
        Add patterns to the exclude list.
        Parameters:
        list - The list of patterns to be added.
      • addExcludeListPattern

        public static void addExcludeListPattern​(java.lang.String pattern)
        Add pattern to the exclude list.
        Parameters:
        pattern - The pattern to be added to the exclude list.
      • setExcludeList

        public static void setExcludeList​(java.util.List<java.lang.String> list)
        Set the exclude list.
        Parameters:
        list - The exclude list to set.
      • getExcludeList

        public static java.util.List<java.lang.String> getExcludeList()
        Get excluded file patterns.
        Returns:
        The list of excluded patterns.
      • staticReset

        public static void staticReset()
        Resets the static variables created by this class and sets default filetype associations. For use with the DBB Shared Daemon
      • clear

        public static void clear()
        Clear the static variables created by this class and remove all default filetype associations.