Class MessagesSourceCrawler


  • public class MessagesSourceCrawler
    extends Object
    This class takes care of crawling through the source code
    • Method Detail

      • addKeyOccurrence

        public void addKeyOccurrence​(KeyOccurrence occ)
        Add a key occurrence to the list of occurrences. The list is kept sorted on key and message package. If the key already exists, we increment the number of occurrences.
        Parameters:
        occ - The key occurrence to add
      • lookForOccurrencesInFile

        public void lookForOccurrencesInFile​(String sourceFolder,
                                             org.apache.commons.vfs2.FileObject javaFile)
                                      throws IOException
        Look for additional occurrences of keys in the specified file.
        Parameters:
        sourceFolder - The folder the java file and messages files live in
        javaFile - The java source file to examine
        Throws:
        IOException - In case there is a problem accessing the specified source file.
      • getMessagesPackagesList

        public List<String> getMessagesPackagesList​(String sourceFolder)
        Returns:
        A sorted list of distinct occurrences of the used message package names
      • getOccurrencesForPackage

        public List<KeyOccurrence> getOccurrencesForPackage​(String messagesPackage)
        Get all the key occurrences for a certain messages package.
        Parameters:
        messagesPackage - the package to hunt for
        Returns:
        all the key occurrences for a certain messages package.
      • getKeyOccurrences

        public List<KeyOccurrence> getKeyOccurrences​(String sourceFolder)
        Get the unique package-key
        Parameters:
        sourceFolder -
      • getSourceDirectories

        public List<String> getSourceDirectories()
        Gets sourceDirectories
        Returns:
        value of sourceDirectories
      • setSourceDirectories

        public void setSourceDirectories​(List<String> sourceDirectories)
        Parameters:
        sourceDirectories - The sourceDirectories to set
      • getBundlesStore

        public BundlesStore getBundlesStore()
        Gets bundlesStore
        Returns:
        value of bundlesStore
      • setBundlesStore

        public void setBundlesStore​(BundlesStore bundlesStore)
        Parameters:
        bundlesStore - The bundlesStore to set
      • getSourcePackageOccurrences

        public Map<String,​Map<String,​List<KeyOccurrence>>> getSourcePackageOccurrences()
        Gets sourcePackageOccurrences
        Returns:
        value of sourcePackageOccurrences
      • setSourcePackageOccurrences

        public void setSourcePackageOccurrences​(Map<String,​Map<String,​List<KeyOccurrence>>> sourcePackageOccurrences)
        Parameters:
        sourcePackageOccurrences - The sourcePackageOccurrences to set
      • getFilesToAvoid

        public List<String> getFilesToAvoid()
        Gets filesToAvoid
        Returns:
        value of filesToAvoid
      • setFilesToAvoid

        public void setFilesToAvoid​(List<String> filesToAvoid)
        Parameters:
        filesToAvoid - The filesToAvoid to set
      • getPackagePattern

        public Pattern getPackagePattern()
        Gets packagePattern
        Returns:
        value of packagePattern
      • setPackagePattern

        public void setPackagePattern​(Pattern packagePattern)
        Parameters:
        packagePattern - The packagePattern to set
      • getImportPattern

        public Pattern getImportPattern()
        Gets importPattern
        Returns:
        value of importPattern
      • setImportPattern

        public void setImportPattern​(Pattern importPattern)
        Parameters:
        importPattern - The importPattern to set
      • getStringPkgPattern

        public Pattern getStringPkgPattern()
        Gets stringPkgPattern
        Returns:
        value of stringPkgPattern
      • setStringPkgPattern

        public void setStringPkgPattern​(Pattern stringPkgPattern)
        Parameters:
        stringPkgPattern - The stringPkgPattern to set
      • getClassPkgPatterns

        public List<Pattern> getClassPkgPatterns()
        Gets classPkgPatterns
        Returns:
        value of classPkgPatterns
      • setClassPkgPatterns

        public void setClassPkgPatterns​(List<Pattern> classPkgPatterns)
        Parameters:
        classPkgPatterns - The classPkgPatterns to set
      • getLog

        public ILogChannel getLog()
        Gets log
        Returns:
        value of log
      • setLog

        public void setLog​(ILogChannel log)
        Parameters:
        log - The log to set
      • getRootFolder

        public String getRootFolder()
        Gets rootFolder
        Returns:
        value of rootFolder
      • setRootFolder

        public void setRootFolder​(String rootFolder)
        Parameters:
        rootFolder - The rootFolder to set