org.pentaho.di.ui.i18n
Class MessagesSourceCrawler
java.lang.Object
org.pentaho.di.ui.i18n.MessagesSourceCrawler
public class MessagesSourceCrawler
- extends Object
This class takes care of crawling through the source code
- Author:
- matt
MessagesSourceCrawler
public MessagesSourceCrawler(LogChannelInterface log,
List<String> sourceDirectories,
String singleMessagesFile,
List<SourceCrawlerXMLFolder> xmlFolders)
- Parameters:
sourceDirectories
- The source directories to crawl throughsingleMessagesFile
- the messages file if there is only one, otherwise: null
getSourceDirectories
public List<String> getSourceDirectories()
- Returns:
- The source directories to crawl through
setSourceDirectories
public void setSourceDirectories(List<String> sourceDirectories)
- Parameters:
sourceDirectories
- The source directories to crawl through
getOccurrences
public List<KeyOccurrence> getOccurrences()
- Returns:
- the occurrences
setOccurrences
public void setOccurrences(List<KeyOccurrence> occurrences)
- Parameters:
occurrences
- the occurrences to set
getFilesToAvoid
public List<String> getFilesToAvoid()
- Returns:
- the files to avoid
setFilesToAvoid
public void setFilesToAvoid(List<String> filesToAvoid)
- Parameters:
filesToAvoid
- the files to avoid
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
crawl
public void crawl()
throws Exception
- Throws:
Exception
lookForOccurrencesInFile
public void lookForOccurrencesInFile(org.apache.commons.vfs.FileObject fileObject)
throws IOException
- Look for additional occurrences of keys in the specified file.
- Parameters:
fileObject
- The java source file to examine
- Throws:
IOException
- In case there is a problem accessing the specified source
file.
getMessagesPackagesList
public List<String> getMessagesPackagesList()
- 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 messsages package.
- Parameters:
messagesPackage
- the package to hunt for
- Returns:
- all the key occurrences for a certain messages package.
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
getKeyOccurrence
public KeyOccurrence getKeyOccurrence(String key,
String selectedMessagesPackage)
getSingleMessagesFile
public String getSingleMessagesFile()
- Returns:
- the singleMessagesFile
setSingleMessagesFile
public void setSingleMessagesFile(String singleMessagesFile)
- Parameters:
singleMessagesFile
- the singleMessagesFile to set
getScanPhrases
public String[] getScanPhrases()
- Returns:
- the scanPhrases
setScanPhrases
public void setScanPhrases(String[] scanPhrases)
- Parameters:
scanPhrases
- the scanPhrases to set
getPackageOccurrences
public Map<String,List<KeyOccurrence>> getPackageOccurrences()
- Returns:
- the packageOccurrences
setPackageOccurrences
public void setPackageOccurrences(Map<String,List<KeyOccurrence>> packageOccurrences)
- Parameters:
packageOccurrences
- the packageOccurrences to set