Klasse UtilException

java.lang.Object
java.lang.Throwable
java.lang.Exception
de.zocher_regel.util.UtilException
Alle implementierten Schnittstellen:
Serializable

public class UtilException extends Exception
Exception of this package and error logging. Every package using de.zocher_regel.util should define its own exception inheriting from this one.
Siehe auch:
  • Konstruktordetails

    • UtilException

      public UtilException(Level level, Throwable cause, String msgTemplate, Object... msgParms)
      Exception of this module. Each other modules has its own exception, which inherits from this on. UtilException and its descendants are responsible for message logging as well.
      Parameter:
      level - DEBUG, INFO, WARNING, SEVERE
      cause - if another exception is the cause of this exception, else null.
      msgTemplate - a key with placeholders (e. g. %1$s) for NLS resolution, @see UtilNls.
      msgParms - for each placeholder in msgTemplate
  • Methodendetails

    • initLog

      static void initLog(Appendable appendable)
      Initialize logging, so that logging messages can be written to the logging pane.
      Parameter:
      appendable - where the message are to be appended to
    • log

      public static void log(Level level, Throwable cause, String msgTemplate, Object... msgParms)
      Log by creating a temporary UtilException and call its logging
      Parameter:
      level - like INFO, WARNING, SEVERE
      cause - the causing Throwable, else null
      msgTemplate - an NLS key with placeholders (%1$s, ..., @see UtilNls)
      msgParms - for the placeholders %1$s ...
    • nls

      static String nls(String keyFormat, Object... msgParms)
      Get the natural language message from a key with placeholders
      Parameter:
      keyFormat - used by @see UtilNls (like "
      msgParms - for the placeholders %1$s ...
      Gibt zurück:
      the NLS message
    • replaceSpecialCharacters

      public static final String replaceSpecialCharacters(String str)
      Replace unwanted characters like 'ſ'.
      Parameter:
      str - the String that may have unwanted characters
      Gibt zurück:
      the String where these characters have been replaced
    • getLevel

      public final Level getLevel()
      The UtilException has a java.util.logging.Level.
      Gibt zurück:
      the error level of the message (e. g. SEVERE)
    • getLocalizedMessage

      public final String getLocalizedMessage()
      The logging message NLS enabled by @see UtilNls. If the message starts with " ", national language support is bypassed.
      Setzt außer Kraft:
      getLocalizedMessage in Klasse Throwable
      Gibt zurück:
      the message, mostly in user's language (en, de)
    • getResourceBundle

      protected ResourceBundle getResourceBundle()
      This exception and its descendants have a resourceBundle for NLS resolution.
      Gibt zurück:
      the resourceBundle, here UtilNls
    • log

      public final void log()
      Log a message to the logging pane and beep if wanted.