}
Set<ConstraintViolation<Object>> violations = new HashSet<ConstraintViolation<Object>>();
MethodMetadata method = metadata.getMethodMetadata(ctx.getMethod());
ValidateRequest interceptorBinding = method.getInterceptorBinding();
Class<?>[] groups = interceptorBinding.groups();
// validate JAX-RS resource fields
if (interceptorBinding.validateResourceFields()) {
log.debugv("Validating JAX-RS resource {0}", ctx.getTarget());
violations.addAll(validator.validate(ctx.getTarget(), groups));
}
// validate message body
if (interceptorBinding.validateMessageBody() && (method.getMessageBody() != null)) {
Object parameter = ctx.getParameters()[method.getMessageBody()];
log.debugv("Validating HTTP message body {0}", parameter);
violations.addAll(validator.validate(parameter, groups));
}