Package org.glassfish.jersey.server
Class ParamException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.ws.rs.WebApplicationException
org.glassfish.jersey.server.ParamException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FormDataParamException
,ParamException.CookieParamException
,ParamException.FormParamException
,ParamException.HeaderParamException
,ParamException.UriParamException
An abstract extension of
WebApplicationException
for the class of
parameter-based exceptions.
Exceptions that are instances of this class will be thrown if the runtime
encounters an error obtaining a parameter value, from a request, for a
Java type that is annotated with a parameter-based annotation, such as
QueryParam
. For more details see
section 3.2
of the JAX-RS specification.
An ExceptionMapper
may be configured to map this class or a sub-class
of to customize responses for parameter-based errors.
Unless otherwise stated all such exceptions of this type will contain a response with a 400 (Client error) status code.
- Author:
- Paul Sandoz, Marek Potociar
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A parameter exception for errors withCookieParam
.static class
A parameter exception for errors withFormParam
.static class
A parameter exception for errors withHeaderParam
.static class
A URI-parameter-based exception for errors withMatrixParam
.static class
A URI-parameter-based exception for errors withPathParam
.static class
A URI-parameter-based exception for errors withQueryParam
.static class
An abstract parameter exception for the class of URI-parameter-based exceptions. -
Constructor Summary
ModifierConstructorDescriptionprotected
ParamException
(Throwable cause, Response.StatusType status, Class<? extends Annotation> parameterType, String name, String defaultStringValue) -
Method Summary
Modifier and TypeMethodDescriptionGet the default String value.Get the parameter name.Class<? extends Annotation>
Get the type of the parameter annotation.Methods inherited from class jakarta.ws.rs.WebApplicationException
getResponse
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParamException
protected ParamException(Throwable cause, Response.StatusType status, Class<? extends Annotation> parameterType, String name, String defaultStringValue)
-
-
Method Details
-
getParameterType
Get the type of the parameter annotation.- Returns:
- the type of the parameter annotation.
-
getParameterName
Get the parameter name.- Returns:
- the parameter name.
-
getDefaultStringValue
Get the default String value.- Returns:
- the default String value.
-