Package org.pentaho.di.ui.i18n
Class MessagesStore
java.lang.Object
org.pentaho.di.core.changed.ChangedFlag
org.pentaho.di.ui.i18n.MessagesStore
- All Implemented Interfaces:
org.pentaho.di.core.changed.ChangedFlagInterface
public class MessagesStore
extends org.pentaho.di.core.changed.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...
- Author:
- matt
-
Constructor Summary
ConstructorDescriptionMessagesStore
(String locale, String sourceFolder, String messagesPackage, Map<String, Map<String, List<KeyOccurrence>>> sourcePackageOccurrences) Create a new messages store -
Method Summary
Modifier and TypeMethodDescriptiongetLoadFilename
(List<String> alternativeSourceFolders) Find a suitable filename for the specified locale and messages package.getSaveFilename
(String directory) Find a suitable filename to save this information in the specified locale and messages package.getSourceDirectory
(List<String> directories) void
void
setFilename
(String filename) void
void
setMessagesMap
(Map<String, String> messsagesMap) void
setMessagesPackage
(String messagesPackage) void
setSourceFolder
(String sourceFolder) void
write()
void
Methods inherited from class org.pentaho.di.core.changed.ChangedFlag
addObserver, clearChanged, deleteObserver, hasChanged, notifyObservers, setChanged, setChanged
-
Constructor Details
-
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 Details
-
read
- Throws:
org.pentaho.di.core.exception.KettleException
-
write
public void write() throws org.pentaho.di.core.exception.KettleException- Throws:
org.pentaho.di.core.exception.KettleException
-
write
- Throws:
org.pentaho.di.core.exception.KettleException
-
getLoadFilename
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
-directories
- the source directories to try and map the messages files against.- Returns:
- the filename that was found.
- Throws:
FileNotFoundException
-
getSourceDirectory
-
getSaveFilename
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
- Returns:
- the locale
-
setLocale
- Parameters:
locale
- the locale to set
-
getMessagesPackage
- Returns:
- the messagesPackage
-
setMessagesPackage
- Parameters:
messagesPackage
- the messagesPackage to set
-
getMessagesMap
- Returns:
- the map
-
setMessagesMap
- Parameters:
messsagesMap
- the map to set
-
getFilename
-
setFilename
-
getSourceFolder
-
setSourceFolder
-