com.atlassian.plugins.rest.common.validation
Class ValidationInterceptor
java.lang.Object
com.atlassian.plugins.rest.common.validation.ValidationInterceptor
- All Implemented Interfaces:
- ResourceInterceptor
public class ValidationInterceptor
- extends java.lang.Object
- implements ResourceInterceptor
Uses JSR-303 to validate incoming entity objects. If validation fails, it will return a 400 with a ValidationErrors
instance containing the constraint violations. The error messages will be processed with either SAL or the
provided custom MessageInterpolator.
- Since:
- 2.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidationInterceptor
public ValidationInterceptor(com.atlassian.sal.api.message.I18nResolver i18nResolver)
ValidationInterceptor
public ValidationInterceptor(javax.validation.MessageInterpolator messageInterpolator)
intercept
public void intercept(MethodInvocation invocation)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
- Description copied from interface:
ResourceInterceptor
- Intercepts the method invocation
- Specified by:
intercept in interface ResourceInterceptor
- Parameters:
invocation - Context information about the invocation
- Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
Copyright © 2014 Atlassian. All Rights Reserved.