Package org.apache.hop.ui.i18n
Class MessagesStore
- java.lang.Object
-
- org.apache.hop.core.changed.ChangedFlag
-
- org.apache.hop.ui.i18n.MessagesStore
-
- All Implemented Interfaces:
IChanged
public class MessagesStore extends ChangedFlag
This class contains a messages store: for a certain Locale and for a certain messages package, it keeps all the keys and values. This class can read and write messages files...
-
-
Constructor Summary
Constructors Constructor Description MessagesStore()MessagesStore(String bundleRootFolder, String filename)Determine locale and package from filenameMessagesStore(String locale, String sourceFolder, String messagesPackage, Map<String,Map<String,List<KeyOccurrence>>> sourcePackageOccurrences)Create a new messages store
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFilename()StringgetLoadFilename(List<String> alternativeSourceFolders)Find a suitable filename for the specified locale and messages package.StringgetLocale()Map<String,String>getMessagesMap()StringgetMessagesPackage()StringgetSaveFilename(String directory)Find a suitable filename to save this information in the specified locale and messages package.StringgetSourceDirectory(List<String> directories)StringgetSourceFolder()voidread(List<String> directories)voidsetFilename(String filename)voidsetLocale(String locale)voidsetMessagesMap(Map<String,String> messsagesMap)voidsetMessagesPackage(String messagesPackage)voidsetSourceFolder(String sourceFolder)voidwrite()voidwrite(String filename)-
Methods inherited from class org.apache.hop.core.changed.ChangedFlag
addObserver, clearChanged, deleteObserver, hasChanged, notifyObservers, setChanged, setChanged
-
-
-
-
Constructor Detail
-
MessagesStore
public MessagesStore()
-
MessagesStore
public MessagesStore(String locale, String sourceFolder, String messagesPackage, Map<String,Map<String,List<KeyOccurrence>>> sourcePackageOccurrences)
Create a new messages store- Parameters:
locale- The locale to readsourceFolder- The source folder to readmessagesPackage- The messages package to considersourcePackageOccurrences- The occurrences map
-
-
Method Detail
-
read
public void read(List<String> directories) throws HopException
- Throws:
HopException
-
write
public void write() throws HopException- Throws:
HopException
-
write
public void write(String filename) throws HopException
- Throws:
HopException
-
getLoadFilename
public String getLoadFilename(List<String> alternativeSourceFolders) throws FileNotFoundException
Find a suitable filename for the specified locale and messages package. It tries to find the file in the specified directories in the order that they are specified.- Parameters:
alternativeSourceFolders-- Returns:
- the filename that was found.
- Throws:
FileNotFoundException
-
getSaveFilename
public String getSaveFilename(String directory)
Find a suitable filename to save this information in the specified locale and messages package. It needs a source directory to save the package in- Parameters:
directory- the source directory to save the messages file in.- Returns:
- the filename that was generated.
-
getLocale
public String getLocale()
- Returns:
- the locale
-
setLocale
public void setLocale(String locale)
- Parameters:
locale- the locale to set
-
getMessagesPackage
public String getMessagesPackage()
- Returns:
- the messagesPackage
-
setMessagesPackage
public void setMessagesPackage(String messagesPackage)
- Parameters:
messagesPackage- the messagesPackage to set
-
setMessagesMap
public void setMessagesMap(Map<String,String> messsagesMap)
- Parameters:
messsagesMap- the map to set
-
getFilename
public String getFilename()
-
setFilename
public void setFilename(String filename)
-
getSourceFolder
public String getSourceFolder()
-
setSourceFolder
public void setSourceFolder(String sourceFolder)
-
-