public interface IlrVocabularyManager
IlrVocabularyManager represents a vocabulary manager.
Use the default implementation of this interface to retrieve a vocabulary
from a locale, and be notified when a vocabulary as changed.
Note that if a Vocabulary Manager is necessary in the context of BRLDF, you should implement
IlrBRLVocabularyManager.
The following code example shows how to create and used a customized vocabulary manager.
protected IlrVocabularyManager createVocabularyManager(final IlrObjectModel bom) {
IlrVocabularyManager vocManager = new IlrVocabularyManager() {
private HashMap vocs = new HashMap();
public void addChangeListener(ChangeListener listener) {}
public void removeChangeListener(ChangeListener listener) {}
public IlrVocabulary getVocabulary(Locale locale) {
IlrVocabulary res = vocs.get(locale);
if (res == null) {
res = IlrBOMVocabularyFactory.createBOMVocabularySet(locale,
createVocabulary(bom, locale),
true);
IlrVocabularyHelper.enableCacheManager(res, true);
if (res != null) {
vocs.put(locale, res);
}
}
return res;
}
};
return vocManager;
}
| Modifier and Type | Interface and Description |
|---|---|
static class |
IlrVocabularyManager.ChangeEvent
Represents the event to notify when a vocabulary changes.
|
static interface |
IlrVocabularyManager.ChangeListener
The listener interface for receiving events when a vocabulary has been modified.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(IlrVocabularyManager.ChangeListener listener)
Adds a listener for notifying when the vocabulary has changed.
|
IlrVocabulary |
getVocabulary(java.util.Locale locale)
Gets a vocabulary for a given locale.
|
void |
removeChangeListener(IlrVocabularyManager.ChangeListener listener)
Removes a listener.
|
IlrVocabulary getVocabulary(java.util.Locale locale)
locale - The locale of the requested vocabulary.void addChangeListener(IlrVocabularyManager.ChangeListener listener)
listener - The listener to add.void removeChangeListener(IlrVocabularyManager.ChangeListener listener)
listener - The listener to remove.© Copyright IBM Corp. 1987, 2017