nl.vpro.rs.converters.LocaleParamConverterProvider Maven / Gradle / Ivy
package nl.vpro.rs.converters;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Locale;
import jakarta.ws.rs.ext.ParamConverter;
import jakarta.ws.rs.ext.ParamConverterProvider;
import jakarta.ws.rs.ext.Provider;
/**
* @author Michiel Meeuwissen
* @since 0.48
*/
@Provider
public class LocaleParamConverterProvider implements ParamConverterProvider {
@SuppressWarnings("unchecked")
@Override
public ParamConverter getConverter(Class rawType, Type genericType, Annotation[] annotations) {
if (Locale.class.isAssignableFrom(rawType)) {
return (ParamConverter) LocaleParamConverter.INSTANCE;
}
return null;
}
}