ilog.rules.vocabulary.model

Interface IlrVocabularyManager

  • All Known Subinterfaces:
    IlrBRLVocabularyManager
    All Known Implementing Classes:
    IlrAbstractVocabularyManager


    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.

    Code example

    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;
     }
     
    • Method Detail

      • getVocabulary

        IlrVocabulary getVocabulary(java.util.Locale locale)
        Gets a vocabulary for a given locale. Note that the vocabulary returned by this API is not supposed to be changed. If the implementor of this interface changes the vocabulary, a Change Event must be sent to the listeners that requested notification.
        Parameters:
        locale - The locale of the requested vocabulary.
        Returns:
        The vocabulary.
      • addChangeListener

        void addChangeListener(IlrVocabularyManager.ChangeListener listener)
        Adds a listener for notifying when the vocabulary has changed.
        Parameters:
        listener - The listener to add.

© Copyright IBM Corp. 1987, 2017