Package org.apache.hop.ui.i18n
Class MessagesSourceCrawler
- java.lang.Object
-
- org.apache.hop.ui.i18n.MessagesSourceCrawler
-
public class MessagesSourceCrawler extends Object
This class takes care of crawling through the source code
-
-
Constructor Summary
Constructors Constructor Description MessagesSourceCrawler()MessagesSourceCrawler(ILogChannel log, String rootFolder, BundlesStore bundlesStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddKeyOccurrence(KeyOccurrence occ)Add a key occurrence to the list of occurrences.voidcrawl()BundlesStoregetBundlesStore()Gets bundlesStoreList<Pattern>getClassPkgPatterns()Gets classPkgPatternsList<String>getFilesToAvoid()Gets filesToAvoidPatterngetImportPattern()Gets importPatternKeyOccurrencegetKeyOccurrence(String key, String selectedMessagesPackage)List<KeyOccurrence>getKeyOccurrences(String sourceFolder)Get the unique package-keyILogChannelgetLog()Gets logList<String>getMessagesPackagesList(String sourceFolder)List<KeyOccurrence>getOccurrencesForPackage(String messagesPackage)Get all the key occurrences for a certain messages package.PatterngetPackagePattern()Gets packagePatternStringgetRootFolder()Gets rootFolderList<String>getSourceDirectories()Gets sourceDirectoriesMap<String,Map<String,List<KeyOccurrence>>>getSourcePackageOccurrences()Gets sourcePackageOccurrencesPatterngetStringPkgPattern()Gets stringPkgPatternvoidlookForOccurrencesInFile(String sourceFolder, org.apache.commons.vfs2.FileObject javaFile)Look for additional occurrences of keys in the specified file.voidsetBundlesStore(BundlesStore bundlesStore)voidsetClassPkgPatterns(List<Pattern> classPkgPatterns)voidsetFilesToAvoid(List<String> filesToAvoid)voidsetImportPattern(Pattern importPattern)voidsetLog(ILogChannel log)voidsetPackagePattern(Pattern packagePattern)voidsetRootFolder(String rootFolder)voidsetSourceDirectories(List<String> sourceDirectories)voidsetSourcePackageOccurrences(Map<String,Map<String,List<KeyOccurrence>>> sourcePackageOccurrences)voidsetStringPkgPattern(Pattern stringPkgPattern)
-
-
-
Constructor Detail
-
MessagesSourceCrawler
public MessagesSourceCrawler()
-
MessagesSourceCrawler
public MessagesSourceCrawler(ILogChannel log, String rootFolder, BundlesStore bundlesStore) throws HopException
- Throws:
HopException
-
-
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 injavaFile- 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.
-
getKeyOccurrence
public KeyOccurrence getKeyOccurrence(String key, String selectedMessagesPackage)
-
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
-
-