io.quarkus.hibernate.validator.runtime.ArcProxyBeanMetaDataClassNormalizer 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 org.hibernate.validator.metadata.BeanMetaDataClassNormalizer;
import io.quarkus.arc.Subclass;
/**
* In the case of a proxy generated by Arc, return the parent class.
*
* This can have more than one level of hierarchy, in example:
*
* - When using @{@link io.quarkus.test.junit.mockito.InjectMock} or @{@link io.quarkus.test.junit.mockito.InjectSpy}
*
*/
public class ArcProxyBeanMetaDataClassNormalizer implements BeanMetaDataClassNormalizer {
@Override
public Class super T> normalize(Class beanClass) {
Class super T> targetClass = beanClass;
while (Subclass.class.isAssignableFrom(targetClass)) {
targetClass = targetClass.getSuperclass();
}
return targetClass;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy