ilog.rules.dt.model

Interface IlrDTResourceManager

  • All Superinterfaces:
    java.io.Serializable


    public interface IlrDTResourceManager
    extends java.io.Serializable
    This interface specifies the contract of a Resource Management Service associated to a Decision Table or Tree model. The resource services allows the model to access localized messages, preferences and localized resources associated to DT elements. This resource manager is given a Display Locale which specifies which locale is used to display information to the DT user. If none is specified, the locale of the DT artifact is used. A DT Model is always assigned a Resource Manager that can be retrieved through DTContext interface. This resource manager is usually initialized with a preference file that store preferences for the DT, a message file that contains locale-specific messages. This interface is not supposed to be implemented outside the DT framework.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.util.Locale getDisplayLocale()
      This method returns the display locale that may have been set on this resource manager.
      IlrDTContext getDTContext()
      This method returns the DT Context to which this resource manager is associated.
      java.lang.Object getLocalizedResource(DTModelElement dtModelElement, IlrDecorableElement dtElement, java.lang.String key, java.lang.Object defaultValue)
      This method returns the locale-specific resource associated to the given DT element registered for the given key or the default value if such a resource does not exist.
      java.lang.String getMessage(java.lang.String key, java.lang.Object[] args, java.lang.String defaultValue)
      This method returns a locale-specific message that has been registered with the given key.
      java.lang.String getPreference(java.lang.String key, java.lang.String defaultValue)
      This method returns the preference registered using the given key or the provided default value if the preference is not found.
      java.lang.Object getResource(DTModelElement dtModelElement, IlrDecorableElement dtElement, java.lang.String key, java.lang.Object defaultValue)
      This method returns a locale-independent resource associated to the given DT element registered for the given key or the default value if such a resource does not exist.
      void setDisplayLocale(java.util.Locale locale)
      This method set a Display Locale to this resource manager.
      void setLocalizedResource(DTModelElement dtModelElement, IlrDecorableElement dtElement, java.lang.String key, java.lang.Object value)
      This method allows setting a locale-specific resource on the given DT Element.
      void setResource(DTModelElement dtModelElement, IlrDecorableElement dtElement, java.lang.String key, java.lang.Object value)
      This method allows setting a locale-independent resource on the given DT Element.
    • Method Detail

      • getDTContext

        IlrDTContext getDTContext()
        This method returns the DT Context to which this resource manager is associated.
        Returns:
        the DT Context
      • getDisplayLocale

        java.util.Locale getDisplayLocale()
        This method returns the display locale that may have been set on this resource manager. If none has been set, the locale of the DT artifact is returned
        Returns:
        the locale used to display information to the user
      • setDisplayLocale

        void setDisplayLocale(java.util.Locale locale)
        This method set a Display Locale to this resource manager. If null is passed as argument, the display locale will be the locale of the DT Artifact. This method is supposed to be called by the editor or any other service that render the DT Model in a locale which is not the locale of the DT artifact.
        Parameters:
        locale - the new Display Locale or null to use the locale of the DT artifact as the Display Locale.
      • getPreference

        java.lang.String getPreference(java.lang.String key,
                                     java.lang.String defaultValue)
        This method returns the preference registered using the given key or the provided default value if the preference is not found.
        Parameters:
        key - the key of the preference to search
        defaultValue - the default value returned if the preference is not found
        Returns:
        the value of the preference or the default value if none has been found
      • getMessage

        java.lang.String getMessage(java.lang.String key,
                                  java.lang.Object[] args,
                                  java.lang.String defaultValue)
        This method returns a locale-specific message that has been registered with the given key. The arguments are used to fill message arguments. the default value is returned if the key has not been found. The Display Locale is used.
        Parameters:
        key - the message key
        args - the message arguments. Can be null.
        defaultValue - the default value
        Returns:
        the message instantiated with the given arguments
      • getLocalizedResource

        java.lang.Object getLocalizedResource(DTModelElement dtModelElement,
                                            IlrDecorableElement dtElement,
                                            java.lang.String key,
                                            java.lang.Object defaultValue)
        This method returns the locale-specific resource associated to the given DT element registered for the given key or the default value if such a resource does not exist. Resources are stored in the resource part of the DT artifact and may be locale-specific. This Display Locale is used to retrieve resources.
        Parameters:
        dtModelElement - the model element associated to the DT element if this one is not already a DT Model Element
        dtElement - the DT element for which the resource has been registered
        key - the resource key
        defaultValue -
        Returns:
        the resource or the default value if no resource has been registered with this key for the given DT element
      • setLocalizedResource

        void setLocalizedResource(DTModelElement dtModelElement,
                                IlrDecorableElement dtElement,
                                java.lang.String key,
                                java.lang.Object value)
        This method allows setting a locale-specific resource on the given DT Element.
        Parameters:
        dtModelElement - the model element associated to the DT element if this one is not already a DT Model Element
        dtElement - the DT element to which the resource is set
        key - the key to register the resource
        value - the value of the resource
      • getResource

        java.lang.Object getResource(DTModelElement dtModelElement,
                                   IlrDecorableElement dtElement,
                                   java.lang.String key,
                                   java.lang.Object defaultValue)
        This method returns a locale-independent resource associated to the given DT element registered for the given key or the default value if such a resource does not exist. This kind of Resources are stored in the locale-independent resource part of the DT artifact.
        Parameters:
        dtModelElement - the model element associated to the DT element if this one is not already a DT Model Element
        dtElement - the DT element for which the resource has been registered
        key - the resource key
        defaultValue -
        Returns:
        the resource or the default value if no resource has been registered with this key for the given DT element
      • setResource

        void setResource(DTModelElement dtModelElement,
                       IlrDecorableElement dtElement,
                       java.lang.String key,
                       java.lang.Object value)
        This method allows setting a locale-independent resource on the given DT Element.
        Parameters:
        dtModelElement - the model element associated to the DT element if this one is not already a DT Model Element
        dtElement - the DT element to which the resource is set
        key - the key to register the resource
        value - the value of the resource

© Copyright IBM Corp. 1987, 2017