Class UiExceptionThrower


  • public class UiExceptionThrower
    extends java.lang.Object
    Utility class for UI-Exception handling.
    • Constructor Summary

      Constructors 
      Constructor Description
      UiExceptionThrower​(java.lang.Class<?> clazz, java.lang.String methodName)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void throwIt​(java.lang.Exception e)
      Throw an NgcUiException containing a log-message only.
      void throwIt​(java.lang.Exception e, java.lang.String localizationKey)
      Throw an NgcUiException containing both a log-message and an error-message for the user.
      void throwIt​(java.lang.Exception e, java.lang.String localizationKey, java.util.Map<java.lang.String,​java.lang.String> replacements)
      Throw an NgcUiException containing both a log-message and an error-message for the user.
      void throwIt​(java.lang.String localizationKey)
      Throw an NgcUiException containing both an error-message for the user only.
      void throwIt​(java.lang.String message, java.lang.String localizationKey)
      Throw an NgcUiException containing both a log-message and an error-message for the user.
      void throwIt​(java.lang.String message, java.lang.String localizationKey, java.util.Map<java.lang.String,​java.lang.String> replacements)
      Throws a NgcUiException containing the error message and the user message with replacements.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UiExceptionThrower

        public UiExceptionThrower​(java.lang.Class<?> clazz,
                                  java.lang.String methodName)
        Constructor.
        Parameters:
        clazz - the class
        methodName - the method name
    • Method Detail

      • throwIt

        public void throwIt​(java.lang.Exception e,
                            java.lang.String localizationKey)
                     throws NgcUiException
        Throw an NgcUiException containing both a log-message and an error-message for the user.
        Parameters:
        e - causing exception
        localizationKey - localization key for user error-message
        Throws:
        NgcUiException - exception to be handled by view
      • throwIt

        public void throwIt​(java.lang.Exception e,
                            java.lang.String localizationKey,
                            java.util.Map<java.lang.String,​java.lang.String> replacements)
                     throws NgcUiException
        Throw an NgcUiException containing both a log-message and an error-message for the user.
        Parameters:
        e - causing exception
        localizationKey - localization key for user error-message
        replacements - string replacements for user error message
        Throws:
        NgcUiException - exception to be handled by view
      • throwIt

        public void throwIt​(java.lang.String message,
                            java.lang.String localizationKey)
                     throws NgcUiException
        Throw an NgcUiException containing both a log-message and an error-message for the user.
        Parameters:
        message - log-message
        localizationKey - localization key for user error-message
        Throws:
        NgcUiException - exception to be handled by view
      • throwIt

        public void throwIt​(java.lang.String localizationKey)
                     throws NgcUiException
        Throw an NgcUiException containing both an error-message for the user only.
        Parameters:
        localizationKey - localization key for user error-message
        Throws:
        NgcUiException - exception to be handled by view
      • throwIt

        public void throwIt​(java.lang.Exception e)
                     throws NgcUiException
        Throw an NgcUiException containing a log-message only.
        Parameters:
        e - causing exception
        Throws:
        NgcUiException - exception to be handled by view
      • throwIt

        public void throwIt​(java.lang.String message,
                            java.lang.String localizationKey,
                            java.util.Map<java.lang.String,​java.lang.String> replacements)
                     throws NgcUiException
        Throws a NgcUiException containing the error message and the user message with replacements.
        Parameters:
        message - error message
        localizationKey - localization key for user message
        replacements - replacements for user message
        Throws:
        NgcUiException - exception to be handled by view