io.quarkus.hibernate.validator.runtime.locale.ResteasyClassicLocaleResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-hibernate-validator Show documentation
Show all versions of quarkus-hibernate-validator Show documentation
Validate object properties (field, getter) and method parameters for your beans (REST, CDI, Jakarta Persistence)
package io.quarkus.hibernate.validator.runtime.locale;
import java.util.List;
import java.util.Map;
import jakarta.inject.Singleton;
import jakarta.ws.rs.core.HttpHeaders;
import org.jboss.resteasy.core.ResteasyContext;
@Singleton
public class ResteasyClassicLocaleResolver extends AbstractLocaleResolver {
@Override
protected Map> getHeaders() {
HttpHeaders httpHeaders = ResteasyContext.getContextData(HttpHeaders.class);
if (httpHeaders != null) {
return httpHeaders.getRequestHeaders();
} else {
return null;
}
}
}