io.quarkus.hibernate.validator.runtime.ValidatorProvider 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;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Named;
import jakarta.inject.Singleton;
import jakarta.validation.Validator;
import org.hibernate.validator.HibernateValidatorFactory;
@Singleton
public class ValidatorProvider {
@Produces
@Named("quarkus-hibernate-validator-factory")
@Singleton
public HibernateValidatorFactory factory() {
return ValidatorHolder.getValidatorFactory();
}
@Produces
@Singleton
public Validator validator() {
return ValidatorHolder.getValidator();
}
}