Package nz.org.riskscape.engine.bind
Class ParameterBindingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
nz.org.riskscape.engine.RiskscapeException
nz.org.riskscape.engine.bind.ParameterBindingException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
UnbindableParameterException
Thrown by ParameterBinder
s 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 Summary
ConstructorDescriptionParameterBindingException
(Parameter parameter, String format, Object... args) ParameterBindingException
(Parameter parameter, List<Problem> problems) Build a binding exception that wraps a list of Problems, wrapping them in afoundWith
error that includes the parameter as contextParameterBindingException
(Parameter parameter, Problem problem) -
Method Summary
Modifier and TypeMethodDescriptionExtends 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.Methods inherited from class nz.org.riskscape.engine.RiskscapeException
getCause, hasProblem
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParameterBindingException
-
ParameterBindingException
Build a binding exception that wraps a list of Problems, wrapping them in a
foundWith
error that includes the parameter as context -
ParameterBindingException
-
-
Method Details
-
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 ofgetMessage
- Overrides:
getProblem
in classRiskscapeException
- Returns:
- the problem associated with this exception, or null if there is none
-
getModelParameter
-