Package io.dropwizard.jersey.params
Class AbstractParamConverter<T>
java.lang.Object
io.dropwizard.jersey.params.AbstractParamConverter<T>
- All Implemented Interfaces:
jakarta.ws.rs.ext.ParamConverter<T>
public class AbstractParamConverter<T>
extends Object
implements jakarta.ws.rs.ext.ParamConverter<T>
Converter to Jersey for Dropwizard's *Param classes.
When a param class is used as a resource parameter this converter will instantiate the parameter class with the value provided and the name of the parameter, so if value parsing fails the parameter name can be used in the error message. If the param class does not have a two-string constructor this provider will return null, causing jersey to use the single-string constructor for the parameter type as it normally would.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.ws.rs.ext.ParamConverter
jakarta.ws.rs.ext.ParamConverter.Lazy -
Constructor Summary
ConstructorsConstructorDescriptionAbstractParamConverter(Constructor<T> constructor, String parameterName, @Nullable String defaultValue) -
Method Summary
-
Constructor Details
-
AbstractParamConverter
public AbstractParamConverter(Constructor<T> constructor, String parameterName, @Nullable String defaultValue)
-
-
Method Details
-
fromString
- Specified by:
fromStringin interfacejakarta.ws.rs.ext.ParamConverter<T>
-
toString
- Specified by:
toStringin interfacejakarta.ws.rs.ext.ParamConverter<T>- Throws:
IllegalArgumentException
-