Class BizLogicAppException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EmbeddedParameterUtil.ParameterNotFoundException, EmbeddedParameterUtil.StringFormatIncorrectException

public class BizLogicAppException extends SingleAppException
Is used for buziness logic exceptions.

Messages are designated by messageId, which is defined in messages[_xxx].properties.

See Also:
  • Constructor Details

    • BizLogicAppException

      public BizLogicAppException(@RequireNonnull String messageId, @RequireNonnull String... messageArgs)
      Constructs a new instance with messageId and messageArgs.
      Parameters:
      messageId - message ID
      messageArgs - message Arguments
    • BizLogicAppException

      public BizLogicAppException(@Nullable String[] itemPropertyPaths, @RequireNonnull String messageId, @RequireNonnull String... messageArgs)
      Constructs a new instance with itemPropertyPaths, messageId and messageArgs.
      Parameters:
      itemPropertyPaths - the itemPropertyPaths related to the exception
      messageId - message ID
      messageArgs - message Arguments
    • BizLogicAppException

      public BizLogicAppException(@RequireNonnull String messageId, @RequireNonnull PropertyFileUtil.Arg[] messageArgs)
      Constructs a new instance with messageId and messageArgs.
      Parameters:
      messageId - message ID
      messageArgs - message Arguments
    • BizLogicAppException

      public BizLogicAppException(@Nullable String[] itemPropertyPaths, @RequireNonnull String messageId, @Nullable PropertyFileUtil.Arg[] messageArgs)
      Constructs a new instance with itemPropertyPaths, messageId and messageArgs.
      Parameters:
      itemPropertyPaths - the itemPropertyPaths related to the exception
      messageId - message ID
      messageArgs - message Arguments
  • Method Details

    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getItemPropertyPaths

      @Nonnull public String[] getItemPropertyPaths()
      Description copied from class: SingleAppException
      Provides the location of an item at which this error occurred.

      Its data-type is an array because although standard jakarta validation (like @NotEmpty has only one property path, but BizLogicAppException which describes an error of some relation between multiple items may have multiple property paths.

      Specified by:
      getItemPropertyPaths in class SingleAppException
      Returns:
      an array of propertyPath
    • getMessageId

      @Nonnull public String getMessageId()
      Gets messageId.
      Returns:
      messageId
    • getMessageArgs

      @Nonnull public PropertyFileUtil.Arg[] getMessageArgs()
      Gets messageArgs.
      Returns:
      messageArgs
    • cause

      public BizLogicAppException cause(Throwable th)
      Provides Throwable.initCause(Throwable) with method chain.
      Parameters:
      th - throwable
      Returns:
      BizLogicAppException for method chain