Class ValidationAppException

All Implemented Interfaces:
Serializable

public class ValidationAppException extends SingleAppException
Holds a Jakarta Validations violation.

Normally ConstraintViolationBeanException should be used Since it's alike to jakarta validation standard ConstraintViolationException.
But sometimes you can use it when you want to treat ConstraintViolationBean as one exception (mainly in libraries or frameworks)

It's not recommended to use in apps from the view of understandability.

See Also:
  • Constructor Details

    • ValidationAppException

      public <T> ValidationAppException(@RequireNonnull jakarta.validation.ConstraintViolation<T> violation)
      Constructs a new instance with Jakarta Validation violation.
      Parameters:
      violation - violation result
    • ValidationAppException

      public <T> ValidationAppException(@RequireNonnull ConstraintViolationBean<T> bean)
      Constructs a new instance with BeanValidationErrorInfoBean.
      Parameters:
      bean - ConstraintViolationBean
  • Method Details

    • getConstraintViolationBean

      public ConstraintViolationBean<?> getConstraintViolationBean()
      Gets BeanValidationErrorInfoBean.
      Returns:
      BeanValidationErrorInfoBean
    • getItemPropertyPaths

      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