|
|
|
@ -11,7 +11,6 @@ import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.function.Predicate;
|
|
|
|
import java.util.function.Predicate;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.ClockProvider;
|
|
|
|
import javax.validation.ClockProvider;
|
|
|
|
import javax.validation.Constraint;
|
|
|
|
import javax.validation.Constraint;
|
|
|
|
@ -32,6 +31,7 @@ import org.jboss.jandex.DotName;
|
|
|
|
import org.jboss.jandex.IndexView;
|
|
|
|
import org.jboss.jandex.IndexView;
|
|
|
|
import org.jboss.jandex.MethodInfo;
|
|
|
|
import org.jboss.jandex.MethodInfo;
|
|
|
|
import org.jboss.jandex.Type;
|
|
|
|
import org.jboss.jandex.Type;
|
|
|
|
|
|
|
|
import org.pagan.formalist.interceptor.MethodValidationInterceptor;
|
|
|
|
|
|
|
|
|
|
|
|
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
|
|
|
|
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
|
|
|
|
import io.quarkus.arc.deployment.AnnotationsTransformerBuildItem;
|
|
|
|
import io.quarkus.arc.deployment.AnnotationsTransformerBuildItem;
|
|
|
|
@ -41,23 +41,15 @@ import io.quarkus.arc.deployment.UnremovableBeanBuildItem;
|
|
|
|
import io.quarkus.arc.processor.BeanInfo;
|
|
|
|
import io.quarkus.arc.processor.BeanInfo;
|
|
|
|
import io.quarkus.deployment.Capabilities;
|
|
|
|
import io.quarkus.deployment.Capabilities;
|
|
|
|
import io.quarkus.deployment.Capability;
|
|
|
|
import io.quarkus.deployment.Capability;
|
|
|
|
import io.quarkus.deployment.Feature;
|
|
|
|
|
|
|
|
import io.quarkus.deployment.annotations.BuildProducer;
|
|
|
|
import io.quarkus.deployment.annotations.BuildProducer;
|
|
|
|
import io.quarkus.deployment.annotations.BuildStep;
|
|
|
|
import io.quarkus.deployment.annotations.BuildStep;
|
|
|
|
import io.quarkus.deployment.annotations.Record;
|
|
|
|
import io.quarkus.deployment.annotations.Record;
|
|
|
|
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.FeatureBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.FeatureBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
|
|
|
|
|
|
|
|
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.nativeimage.NativeImageConfigBuildItem;
|
|
|
|
|
|
|
|
import io.quarkus.deployment.builditem.nativeimage.ReflectiveFieldBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.nativeimage.ReflectiveFieldBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem;
|
|
|
|
import io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem;
|
|
|
|
import io.quarkus.deployment.logging.LogCleanupFilterBuildItem;
|
|
|
|
|
|
|
|
import io.quarkus.deployment.recording.RecorderContext;
|
|
|
|
import io.quarkus.deployment.recording.RecorderContext;
|
|
|
|
//import org.pagan.formalist.HibernateValidatorBuildTimeConfig;
|
|
|
|
|
|
|
|
import org.pagan.formalist.HibernateValidatorRecorder;
|
|
|
|
|
|
|
|
import org.pagan.formalist.ValidatorProvider;
|
|
|
|
|
|
|
|
import org.pagan.formalist.interceptor.MethodValidationInterceptor;
|
|
|
|
|
|
|
|
import io.quarkus.resteasy.server.common.spi.AdditionalJaxRsResourceMethodAnnotationsBuildItem;
|
|
|
|
import io.quarkus.resteasy.server.common.spi.AdditionalJaxRsResourceMethodAnnotationsBuildItem;
|
|
|
|
//import io.quarkus.runtime.LocalesBuildTimeConfig;
|
|
|
|
//import io.quarkus.runtime.LocalesBuildTimeConfig;
|
|
|
|
|
|
|
|
|
|
|
|
@ -88,7 +80,8 @@ class HibernateValidatorProcessor {
|
|
|
|
|
|
|
|
|
|
|
|
private static final DotName REPEATABLE = DotName.createSimple(Repeatable.class.getName());
|
|
|
|
private static final DotName REPEATABLE = DotName.createSimple(Repeatable.class.getName());
|
|
|
|
|
|
|
|
|
|
|
|
private static final Pattern BUILT_IN_CONSTRAINT_REPEATABLE_CONTAINER_PATTERN = Pattern.compile("\\$List$");
|
|
|
|
// private static final Pattern BUILT_IN_CONSTRAINT_REPEATABLE_CONTAINER_PATTERN
|
|
|
|
|
|
|
|
// = Pattern.compile("\\$List$");
|
|
|
|
|
|
|
|
|
|
|
|
// @BuildStep
|
|
|
|
// @BuildStep
|
|
|
|
// HotDeploymentWatchedFileBuildItem configFile() {
|
|
|
|
// HotDeploymentWatchedFileBuildItem configFile() {
|
|
|
|
@ -198,8 +191,9 @@ class HibernateValidatorProcessor {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// we trim the repeatable container suffix if needed
|
|
|
|
// we trim the repeatable container suffix if needed
|
|
|
|
String builtinConstraintCandidate = BUILT_IN_CONSTRAINT_REPEATABLE_CONTAINER_PATTERN
|
|
|
|
// String builtinConstraintCandidate =
|
|
|
|
.matcher(consideredAnnotation.toString()).replaceAll("");
|
|
|
|
// BUILT_IN_CONSTRAINT_REPEATABLE_CONTAINER_PATTERN
|
|
|
|
|
|
|
|
// .matcher(consideredAnnotation.toString()).replaceAll("");
|
|
|
|
// if (builtinConstraints.contains(builtinConstraintCandidate)) {
|
|
|
|
// if (builtinConstraints.contains(builtinConstraintCandidate)) {
|
|
|
|
// detectedBuiltinConstraints.add(builtinConstraintCandidate);
|
|
|
|
// detectedBuiltinConstraints.add(builtinConstraintCandidate);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
@ -252,7 +246,8 @@ class HibernateValidatorProcessor {
|
|
|
|
|
|
|
|
|
|
|
|
Set<Class<?>> classesToBeValidated = new HashSet<>();
|
|
|
|
Set<Class<?>> classesToBeValidated = new HashSet<>();
|
|
|
|
for (DotName className : classNamesToBeValidated) {
|
|
|
|
for (DotName className : classNamesToBeValidated) {
|
|
|
|
classesToBeValidated.add(recorderContext.classProxy(className.toString()));
|
|
|
|
classesToBeValidated
|
|
|
|
|
|
|
|
.add(Class.forName(className.toString(), true, Thread.currentThread().getContextClassLoader()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
beanContainerListener
|
|
|
|
beanContainerListener
|
|
|
|
@ -274,19 +269,21 @@ class HibernateValidatorProcessor {
|
|
|
|
// .build();
|
|
|
|
// .build();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
private static void contributeBuiltinConstraints(Set<String> builtinConstraints,
|
|
|
|
// private static void contributeBuiltinConstraints(Set<String>
|
|
|
|
Set<DotName> consideredAnnotationsCollector) {
|
|
|
|
// builtinConstraints,
|
|
|
|
for (String builtinConstraint : builtinConstraints) {
|
|
|
|
// Set<DotName> consideredAnnotationsCollector) {
|
|
|
|
consideredAnnotationsCollector.add(DotName.createSimple(builtinConstraint));
|
|
|
|
// for (String builtinConstraint : builtinConstraints) {
|
|
|
|
|
|
|
|
// consideredAnnotationsCollector.add(DotName.createSimple(builtinConstraint));
|
|
|
|
// for all built-in constraints, we follow a strict convention for repeatable
|
|
|
|
|
|
|
|
// annotations,
|
|
|
|
// // for all built-in constraints, we follow a strict convention for repeatable
|
|
|
|
// they are all inner classes called List
|
|
|
|
// // annotations,
|
|
|
|
// while not all our built-in constraints are repeatable, let's avoid loading
|
|
|
|
// // they are all inner classes called List
|
|
|
|
// the class to check
|
|
|
|
// // while not all our built-in constraints are repeatable, let's avoid loading
|
|
|
|
consideredAnnotationsCollector.add(DotName.createSimple(builtinConstraint + "$List"));
|
|
|
|
// // the class to check
|
|
|
|
}
|
|
|
|
// consideredAnnotationsCollector.add(DotName.createSimple(builtinConstraint +
|
|
|
|
}
|
|
|
|
// "$List"));
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
private static void contributeClass(Set<DotName> classNamesCollector, IndexView indexView, DotName className) {
|
|
|
|
private static void contributeClass(Set<DotName> classNamesCollector, IndexView indexView, DotName className) {
|
|
|
|
classNamesCollector.add(className);
|
|
|
|
classNamesCollector.add(className);
|
|
|
|
|