Class SingleValueExtractor<T>

java.lang.Object
org.glassfish.jersey.server.internal.inject.AbstractParamValueExtractor<T>
org.glassfish.jersey.server.internal.inject.SingleValueExtractor<T>
Type Parameters:
T - extracted Java type.
All Implemented Interfaces:
MultivaluedParameterExtractor<T>

final class SingleValueExtractor<T> extends AbstractParamValueExtractor<T> implements MultivaluedParameterExtractor<T>
Extract value of the parameter using a single parameter value and the underlying param converter.
  • Constructor Details

    • SingleValueExtractor

      public SingleValueExtractor(javax.ws.rs.ext.ParamConverter<T> converter, String parameterName, String defaultStringValue)
      Create new single value extractor.
      Parameters:
      converter - string value reader.
      parameterName - string parameter name.
      defaultStringValue - default string value.
  • Method Details

    • extract

      public T extract(javax.ws.rs.core.MultivaluedMap<String,String> parameters)
      Extract the map entry identified by a name (and using the configured default value) from the supplied multivalued map.

      This implementation extracts the value of the parameter applying the underlying param converter to the first value found in the list of potential multiple parameter values. Any other values in the multi-value list will be ignored.

      Specified by:
      extract in interface MultivaluedParameterExtractor<T>
      Parameters:
      parameters - map of parameters.
      Returns:
      extracted single parameter value.