com.ibm.commerce.edp.api

Class BaseException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • com.ibm.commerce.edp.api.BaseException
  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    EDPException, PluginException


    public abstract class BaseException
    extends java.lang.Exception
    implements java.io.Serializable
    The base exception class for the payments exception hierarchy.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      BaseException()
      This method creates a new BaseException object.
      BaseException(java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] formatArguments, java.lang.String defaultMessage)
      This method creates a new BaseException object.
      BaseException(java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] formatArguments, java.lang.String defaultMessage, java.lang.Throwable exception)
      This method creates a new BaseException object.
      BaseException(java.lang.Throwable exception)
      This method creates a new BaseException object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addProperties(java.util.Map map)
      This method adds a map into the properties associated with the exception.
      void addProperties(java.util.Properties properties)
      This method adds more properties associated with this exception.
      void addProperty(java.lang.String key, java.lang.Object value)
      This method adds a single property to the exception.
      java.lang.String dumpException()
      This method converts this exception into a human-readable string.
      java.lang.String getClassSource()
      This method returns the name of the class that created the exception.
      java.lang.String getDefaultMessage()
      This method returns the default message associated with this exception.
      java.lang.Object[] getFormatArguments()
      This method returns text format arguments for message to be formated and localized.
      java.lang.String getLocalizedMessage()
      This method returns a localized message using the default Locale.
      java.lang.String getLocalizedMessage(java.util.Locale locale)
      This method returns a localized message.
      java.lang.String getMessage()
      This method will invoke getDefaultMessage().
      java.lang.String getMessageKey()
      This method returns the key of the message to be translated.
      java.lang.String getMethodSource()
      This method returns the name of the method that created the exception.
      java.lang.Throwable getPreviousException()
      This method returns the previous exception that further threw this exception.
      java.util.Properties getProperties()
      This method returns the properties associated with the exception.
      java.lang.String getResourceBundleName()
      This method returns the name of the resource bundle to be used to translate the error message.
      void setClassSource(java.lang.String classSource)
      This method sets the name of the class that created the exception.
      void setDefaultMessage(java.lang.String defaultMessage)
      This method sets the default message of this exception
      void setFormatArguments(java.lang.Object[] formatArguments)
      This method sets text format arguments for message to be formated and localized.
      void setMessageKey(java.lang.String messageKey)
      This method sets the key of the message to be translated.
      void setMethodSource(java.lang.String methodSource)
      This method sets the name of the method that created the exception.
      void setPreviousException(java.lang.Throwable localPreviousException)
      This method sets the previous exception that further threw this exception.
      void setProperties(java.util.Properties properties)
      This method sets the properties associated with the exception.
      void setResourceBundleName(java.lang.String resourceBundleName)
      This method sets the name of the resource bundle to be used to translate the message.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BaseException

        public BaseException()
        This method creates a new BaseException object.
      • BaseException

        public BaseException(java.lang.String resourceBundleName,
                             java.lang.String messageKey,
                             java.lang.Object[] formatArguments,
                             java.lang.String defaultMessage)
        This method creates a new BaseException object.
        Parameters:
        resourceBundleName - The name of the resource bundle to be used to translate the message
        messageKey - The key of the message to be translated
        formatArguments - Parameters to populate the translated message
        defaultMessage - The default message to be used if translation fails
      • BaseException

        public BaseException(java.lang.String resourceBundleName,
                             java.lang.String messageKey,
                             java.lang.Object[] formatArguments,
                             java.lang.String defaultMessage,
                             java.lang.Throwable exception)
        This method creates a new BaseException object.
        Parameters:
        resourceBundleName - The name of the resource bundle to be used to translate the message
        messageKey - The key of the message to be translated
        formatArguments - Parameters to populate the translated message
        defaultMessage - The default message to be used if translation fails
        exception - The exception to be wrapped
      • BaseException

        public BaseException(java.lang.Throwable exception)
        This method creates a new BaseException object.
        Parameters:
        exception - The exception to be wrapped
    • Method Detail

      • setClassSource

        public void setClassSource(java.lang.String classSource)
        This method sets the name of the class that created the exception.
        Parameters:
        classSource - The name of the class that created the exception.
      • getClassSource

        public java.lang.String getClassSource()
        This method returns the name of the class that created the exception.
        Returns:
        The name of the class that created the exception
      • getDefaultMessage

        public java.lang.String getDefaultMessage()
        This method returns the default message associated with this exception.
        Returns:
        The default message associated with this exception
      • getMessage

        public java.lang.String getMessage()
        This method will invoke getDefaultMessage().
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        The message associated with this exception
        See Also:
        getDefaultMessage()
      • setMessageKey

        public void setMessageKey(java.lang.String messageKey)
        This method sets the key of the message to be translated.
        Parameters:
        messageKey - the key of the message to be translated
      • getMessageKey

        public java.lang.String getMessageKey()
        This method returns the key of the message to be translated.
        Returns:
        the key of the message to be translated
      • setMethodSource

        public void setMethodSource(java.lang.String methodSource)
        This method sets the name of the method that created the exception.
        Parameters:
        methodSource - The name of the method that created the exception
      • getMethodSource

        public java.lang.String getMethodSource()
        This method returns the name of the method that created the exception.
        Returns:
        The name of the method that created the exception
      • setPreviousException

        public void setPreviousException(java.lang.Throwable localPreviousException)
        This method sets the previous exception that further threw this exception.
        Parameters:
        localPreviousException - The previous exception to set
      • getPreviousException

        public java.lang.Throwable getPreviousException()
        This method returns the previous exception that further threw this exception.
        Returns:
        the previous exception that further threw this exception
      • setProperties

        public void setProperties(java.util.Properties properties)
        This method sets the properties associated with the exception.
        Parameters:
        Properties - the properties associated with the exception
      • getProperties

        public java.util.Properties getProperties()
        This method returns the properties associated with the exception.
        Returns:
        The properties associated with the exception
      • setResourceBundleName

        public void setResourceBundleName(java.lang.String resourceBundleName)
        This method sets the name of the resource bundle to be used to translate the message.
        Parameters:
        The - name of the resource bundle to be used to translate the message
      • getResourceBundleName

        public java.lang.String getResourceBundleName()
        This method returns the name of the resource bundle to be used to translate the error message.
        Returns:
        The name of the resource bundle to be used to translate the error message
      • addProperties

        public void addProperties(java.util.Properties properties)
        This method adds more properties associated with this exception.
        Parameters:
        properties - more properties to be associated with this exception
      • addProperties

        public void addProperties(java.util.Map map)

        This method adds a map into the properties associated with the exception.

        Properties may be overwritten if the incoming properties have the same name.

        Parameters:
        map - The map to be added into the properties associated with the exception
      • addProperty

        public void addProperty(java.lang.String key,
                                java.lang.Object value)

        This method adds a single property to the exception.

        If a property with the specified key already exists, the value is overwritten.

        Parameters:
        key - The name of the property
        value - The value of the property
      • dumpException

        public java.lang.String dumpException()
        This method converts this exception into a human-readable string.
        Returns:
        A human-readable representation of this exception
      • setDefaultMessage

        public void setDefaultMessage(java.lang.String defaultMessage)
        This method sets the default message of this exception
        Parameters:
        defaultMessage - The default message of this exception
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage()
        This method returns a localized message using the default Locale. This will only retrieve the localized message if the message key, resource bundle and required format parameters have been set up correctly. If the localized message cannot be retrieved, the defaultMessage will be returned.
        Overrides:
        getLocalizedMessage in class java.lang.Throwable
        Returns:
        The localized message if possible; otherwise, the defaultMessage
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage(java.util.Locale locale)
        This method returns a localized message. This will only retrieve the localized message if the message key, resource bundle and required format parameters have been set up correctly. If the localized message cannot be retrieved, the defaultMessage will be returned.
        Parameters:
        The - target locale; if null is specified, uses the default Locale
        Returns:
        The localized message if possible; otherwise, the defaultMessage
      • getFormatArguments

        public java.lang.Object[] getFormatArguments()
        This method returns text format arguments for message to be formated and localized.
        Returns:
        The format arguments for the localized/formatted message
      • setFormatArguments

        public void setFormatArguments(java.lang.Object[] formatArguments)
        This method sets text format arguments for message to be formated and localized.
        Parameters:
        formatArguments - The format arguments for the localized/formatted message