Class ParameterBindingException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
UnbindableParameterException

public class ParameterBindingException extends RiskscapeException

Thrown by ParameterBinders when a value can not be converted to the desired type for some reason. The message will be shown to the user, so make it informative.

See Also:
  • Constructor Details

    • ParameterBindingException

      public ParameterBindingException(Parameter parameter, String format, Object... args)
    • ParameterBindingException

      public ParameterBindingException(Parameter parameter, List<Problem> problems)

      Build a binding exception that wraps a list of Problems, wrapping them in a foundWith error that includes the parameter as context

    • ParameterBindingException

      public ParameterBindingException(Parameter parameter, Problem problem)
  • Method Details

    • getProblem

      public Problem getProblem()

      Extends the default behaviour of getProblem to return either the problem the error was created with, or will concoct one from the message the exception was created with. This is a half-way house - ultimately all the binding code should be changed to use problems and i18n instead of anonymous messages in exceptions, but this at least allows code to start using ParameterBindingException.getProblem instead of getMessage

      Overrides:
      getProblem in class RiskscapeException
      Returns:
      the problem associated with this exception, or null if there is none
    • getModelParameter

      public Parameter getModelParameter()