Class GeneralValidatorImpl
- java.lang.Object
-
- org.jboss.resteasy.plugins.validation.GeneralValidatorImpl
-
- All Implemented Interfaces:
GeneralValidator,GeneralValidatorCDI
public class GeneralValidatorImpl extends Object implements GeneralValidatorCDI
- Version:
- $Revision: 1.1 $ Copyright May 23, 2013
- Author:
- Ron Sigal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classGeneralValidatorImpl.LocaleSpecificMessageInterpolatorprotected static classGeneralValidatorImpl.SimpleMethodFilterA filter implementation filtering methods matching given methods.
-
Field Summary
Fields Modifier and Type Field Description static StringSUPPRESS_VIOLATION_PATH
-
Constructor Summary
Constructors Constructor Description GeneralValidatorImpl(javax.validation.ValidatorFactory validatorFactory, boolean isExecutableValidationEnabled, Set<javax.validation.executable.ExecutableType> defaultValidatedExecutableTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckForConstraintViolations(HttpRequest request, Exception e)voidcheckViolations(HttpRequest request)voidcheckViolationsfromCDI(HttpRequest request)protected static StringconvertArrayToString(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 MethodgetSuperMethod(Method method, Class<?> clazz)Returns a super method, if any, of a method in a class.protected javax.validation.ValidatorgetValidator(HttpRequest request)protected SimpleViolationsContainergetViolationsContainer(HttpRequest request, Object target)protected static booleanisGetter(Method m)booleanisMethodValidatable(Method m)booleanisValidatable(Class<?> clazz)booleanisValidatable(Class<?> clazz, InjectorFactory injectorFactory)booleanisValidatableFromCDI(Class<?> clazz)protected booleanoverrides(Method subTypeMethod, Method superTypeMethod)Checks, whethersubTypeMethodoverridessuperTypeMethod.protected booleanparametersResolveToSameTypes(Method subTypeMethod, Method superTypeMethod)Taken from Hibernate Validatorvoidvalidate(HttpRequest request, Object object, Class<?>... groups)voidvalidateAllParameters(HttpRequest request, Object object, Method method, Object[] parameterValues, Class<?>... groups)voidvalidateReturnValue(HttpRequest request, Object object, Method method, Object returnValue, Class<?>... groups)
-
-
-
Field Detail
-
SUPPRESS_VIOLATION_PATH
public static final String SUPPRESS_VIOLATION_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GeneralValidatorImpl
public GeneralValidatorImpl(javax.validation.ValidatorFactory validatorFactory, boolean isExecutableValidationEnabled, Set<javax.validation.executable.ExecutableType> defaultValidatedExecutableTypes)
-
-
Method Detail
-
validate
public void validate(HttpRequest request, Object object, Class<?>... groups)
- Specified by:
validatein interfaceGeneralValidator
-
checkViolations
public void checkViolations(HttpRequest request)
- Specified by:
checkViolationsin interfaceGeneralValidator
-
checkViolationsfromCDI
public void checkViolationsfromCDI(HttpRequest request)
- Specified by:
checkViolationsfromCDIin interfaceGeneralValidatorCDI
-
validateAllParameters
public void validateAllParameters(HttpRequest request, Object object, Method method, Object[] parameterValues, Class<?>... groups)
- Specified by:
validateAllParametersin interfaceGeneralValidator
-
validateReturnValue
public void validateReturnValue(HttpRequest request, Object object, Method method, Object returnValue, Class<?>... groups)
- Specified by:
validateReturnValuein interfaceGeneralValidator
-
isValidatable
public boolean isValidatable(Class<?> clazz)
- Specified by:
isValidatablein interfaceGeneralValidator
-
isValidatable
public boolean isValidatable(Class<?> clazz, InjectorFactory injectorFactory)
- Specified by:
isValidatablein interfaceGeneralValidatorCDI
-
isValidatableFromCDI
public boolean isValidatableFromCDI(Class<?> clazz)
- Specified by:
isValidatableFromCDIin interfaceGeneralValidatorCDI
-
isMethodValidatable
public boolean isMethodValidatable(Method m)
- Specified by:
isMethodValidatablein interfaceGeneralValidator
-
getExecutableTypesOnMethodInHierarchy
protected List<javax.validation.executable.ExecutableType[]> getExecutableTypesOnMethodInHierarchy(Method method)
-
getExecutableTypesOnMethodInInterfaces
protected List<javax.validation.executable.ExecutableType[]> getExecutableTypesOnMethodInInterfaces(Class<?> clazz, Method method)
-
getExecutableTypesOnMethod
protected static javax.validation.executable.ExecutableType[] getExecutableTypesOnMethod(Method method)
-
isGetter
protected static boolean isGetter(Method m)
-
getSuperMethod
protected Method getSuperMethod(Method method, Class<?> clazz)
Returns a super method, if any, of a method in a class. Here, the "super" relationship is reflexive. That is, a method is a super method of itself.
-
overrides
protected boolean overrides(Method subTypeMethod, Method superTypeMethod)
Checks, whethersubTypeMethodoverridessuperTypeMethod. N.B. "Override" here is reflexive. I.e., a method overrides itself.- Parameters:
subTypeMethod- The sub type method (cannot benull).superTypeMethod- The super type method (cannot benull).- Returns:
- Returns
trueifsubTypeMethodoverridessuperTypeMethod,falseotherwise. Taken from Hibernate Validator
-
parametersResolveToSameTypes
protected boolean parametersResolveToSameTypes(Method subTypeMethod, Method superTypeMethod)
Taken from Hibernate Validator
-
checkForConstraintViolations
public void checkForConstraintViolations(HttpRequest request, Exception e)
- Specified by:
checkForConstraintViolationsin interfaceGeneralValidatorCDI
-
getValidator
protected javax.validation.Validator getValidator(HttpRequest request)
-
getViolationsContainer
protected SimpleViolationsContainer getViolationsContainer(HttpRequest request, Object target)
-
-