public class GeneralValidatorImpl extends Object implements GeneralValidatorCDI
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GeneralValidatorImpl.LocaleSpecificMessageInterpolator |
protected static class |
GeneralValidatorImpl.SimpleMethodFilter
A filter implementation filtering methods matching given methods.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
SUPPRESS_VIOLATION_PATH |
| Constructor and Description |
|---|
GeneralValidatorImpl(javax.validation.ValidatorFactory validatorFactory,
boolean isExecutableValidationEnabled,
Set<javax.validation.executable.ExecutableType> defaultValidatedExecutableTypes) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkForConstraintViolations(HttpRequest request,
Exception e)
Throws a ResteasyViolationException if either a ConstraintViolationException or a
ResteasyConstraintViolationException is embedded in the cause hierarchy of e.
|
void |
checkViolations(HttpRequest request)
Throws a ResteasyViolationException if any validation violations have been detected.
|
void |
checkViolationsfromCDI(HttpRequest request)
Throws a ResteasyViolationException if any validation violations have been detected.
|
protected static String |
convertArrayToString(Object o) |
protected static javax.validation.executable.ExecutableType[] |
getExecutableTypesOnMethod(Method method) |
protected List<javax.validation.executable.ExecutableType[]> |
getExecutableTypesOnMethodInHierarchy(Method method) |
protected List<javax.validation.executable.ExecutableType[]> |
getExecutableTypesOnMethodInInterfaces(Class<?> clazz,
Method method) |
protected Method |
getSuperMethod(Method method,
Class<?> clazz)
Returns a super method, if any, of a method in a class.
|
protected javax.validation.Validator |
getValidator(HttpRequest request) |
protected SimpleViolationsContainer |
getViolationsContainer(HttpRequest request,
Object target) |
protected static boolean |
isGetter(Method m) |
boolean |
isMethodValidatable(Method m)
Indicates if validation is turned on for a method.
|
boolean |
isValidatable(Class<?> clazz)
Indicates if validation is turned on for a class.
|
boolean |
isValidatable(Class<?> clazz,
InjectorFactory injectorFactory)
Indicates if validation is turned on for a class.
|
boolean |
isValidatableFromCDI(Class<?> clazz)
Indicates if validation is turned on for a class.
|
protected boolean |
overrides(Method subTypeMethod,
Method superTypeMethod)
Checks, whether
subTypeMethod overrides superTypeMethod. |
protected boolean |
parametersResolveToSameTypes(Method subTypeMethod,
Method superTypeMethod)
Taken from Hibernate Validator
|
void |
validate(HttpRequest request,
Object object,
Class<?>... groups)
Validates all constraints on
object. |
void |
validateAllParameters(HttpRequest request,
Object object,
Method method,
Object[] parameterValues,
Class<?>... groups)
Validates all constraints placed on the parameters of the given method.
|
void |
validateReturnValue(HttpRequest request,
Object object,
Method method,
Object returnValue,
Class<?>... groups)
Validates all return value constraints of the given method.
|
public static final String SUPPRESS_VIOLATION_PATH
public GeneralValidatorImpl(javax.validation.ValidatorFactory validatorFactory,
boolean isExecutableValidationEnabled,
Set<javax.validation.executable.ExecutableType> defaultValidatedExecutableTypes)
public void validate(HttpRequest request, Object object, Class<?>... groups)
GeneralValidatorobject.validate in interface GeneralValidatorrequest - http requestobject - object to validategroups - the group or list of groups targeted for validation (defaults to
javax.validation.groups.Default)public void checkViolations(HttpRequest request)
GeneralValidatorcheckViolations in interface GeneralValidatorrequest - http requestpublic void checkViolationsfromCDI(HttpRequest request)
GeneralValidatorCDIcheckViolationsfromCDI in interface GeneralValidatorCDIrequest - http requestpublic void validateAllParameters(HttpRequest request, Object object, Method method, Object[] parameterValues, Class<?>... groups)
GeneralValidatorvalidateAllParameters in interface GeneralValidatorrequest - http requestobject - the object on which the method to validate is invokedmethod - the method for which the parameter constraints is validatedparameterValues - the values provided by the caller for the given method's
parametersgroups - the group or list of groups targeted for validation (defaults to
javax.validation.groups.Default)public void validateReturnValue(HttpRequest request, Object object, Method method, Object returnValue, Class<?>... groups)
GeneralValidatorvalidateReturnValue in interface GeneralValidatorrequest - http requestobject - the object on which the method to validate is invokedmethod - the method for which the return value constraints is validatedreturnValue - the value returned by the given methodgroups - the group or list of groups targeted for validation (defaults to
javax.validation.groups.Default)public boolean isValidatable(Class<?> clazz)
GeneralValidatorisValidatable in interface GeneralValidatorclazz - Class to be examinedpublic boolean isValidatable(Class<?> clazz, InjectorFactory injectorFactory)
GeneralValidatorCDIisValidatable in interface GeneralValidatorCDIclazz - Class to be examinedinjectorFactory - the InjectorFactory used for clazzpublic boolean isValidatableFromCDI(Class<?> clazz)
GeneralValidatorCDIisValidatableFromCDI in interface GeneralValidatorCDIclazz - Class to be examinedpublic boolean isMethodValidatable(Method m)
GeneralValidatorisMethodValidatable in interface GeneralValidatorm - method to be examinedprotected List<javax.validation.executable.ExecutableType[]> getExecutableTypesOnMethodInHierarchy(Method method)
protected List<javax.validation.executable.ExecutableType[]> getExecutableTypesOnMethodInInterfaces(Class<?> clazz, Method method)
protected static javax.validation.executable.ExecutableType[] getExecutableTypesOnMethod(Method method)
protected static boolean isGetter(Method m)
protected Method getSuperMethod(Method method, Class<?> clazz)
protected boolean overrides(Method subTypeMethod, Method superTypeMethod)
subTypeMethod overrides superTypeMethod.
N.B. "Override" here is reflexive. I.e., a method overrides itself.subTypeMethod - The sub type method (cannot be null).superTypeMethod - The super type method (cannot be null).true if subTypeMethod overrides superTypeMethod, false otherwise.
Taken from Hibernate Validatorprotected boolean parametersResolveToSameTypes(Method subTypeMethod, Method superTypeMethod)
public void checkForConstraintViolations(HttpRequest request, Exception e)
GeneralValidatorCDIcheckForConstraintViolations in interface GeneralValidatorCDIrequest - http requeste - exceptionprotected javax.validation.Validator getValidator(HttpRequest request)
protected SimpleViolationsContainer getViolationsContainer(HttpRequest request, Object target)
Copyright © 2019 JBoss by Red Hat. All rights reserved.