Class ConfigValidationException

    • Constructor Detail

      • ConfigValidationException

        public ConfigValidationException​(org.osgi.framework.Bundle bundle,
                                         TranslationProvider translationProvider,
                                         Collection<ConfigValidationMessage> configValidationMessages)
        Creates a new ConfigValidationException for the given ConfigValidationMessages. It requires the bundle from which this exception is thrown in order to be able to provide internationalized messages.
        Parameters:
        bundle - the bundle from which this exception is thrown
        configValidationMessages - the configuration description validation messages
        Throws:
        NullPointException - if given bundle or configuration description validation messages are null
    • Method Detail

      • getValidationMessages

        public Map<String,​String> getValidationMessages()
        Retrieves the default validation messages (cp. ConfigValidationMessage.defaultMessage) for this exception.
        Returns:
        an immutable map of validation messages having affected configuration parameter name as key and the default message as value
      • getValidationMessages

        public Map<String,​String> getValidationMessages​(Locale locale)
        Retrieves the internationalized validation messages for this exception. If there is no text found to be internationalized then the default message is delivered.

        If there is no TranslationProvider available then this operation will return the default validation messages by using getValidationMessages().

        Parameters:
        locale - the locale to be used; if null then the default locale will be used
        Returns:
        an immutable map of internationalized validation messages having affected configuration parameter name as key and the internationalized message as value (in case of there was no text found to be internationalized then the default message (cp. ConfigValidationMessage.defaultMessage) is delivered)