@ -1,5 +1,5 @@
/ *
/ *
* Copyright 2002 - 2017 the original author or authors .
* Copyright 2002 - 2019 the original author or authors .
*
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
* you may not use this file except in compliance with the License .
@ -37,6 +37,7 @@ import org.springframework.web.method.ControllerAdviceBean;
* { @link org . springframework . web . method . ControllerAdviceBean ControllerAdviceBean } .
* { @link org . springframework . web . method . ControllerAdviceBean ControllerAdviceBean } .
*
*
* @author Rossen Stoyanchev
* @author Rossen Stoyanchev
* @author Sam Brannen
* @since 4 . 2
* @since 4 . 2
* /
* /
class RequestResponseBodyAdviceChain implements RequestBodyAdvice , ResponseBodyAdvice < Object > {
class RequestResponseBodyAdviceChain implements RequestBodyAdvice , ResponseBodyAdvice < Object > {
@ -48,7 +49,7 @@ class RequestResponseBodyAdviceChain implements RequestBodyAdvice, ResponseBodyA
/ * *
/ * *
* Create an instance from a list of objects that are either of type
* Create an instance from a list of objects that are either of type
* { @code ControllerAdviceBean } or { @code Request BodyAdvice } .
* { @code RequestBodyAdvice } or { @code Response BodyAdvice } .
* /
* /
public RequestResponseBodyAdviceChain ( List < Object > requestResponseBodyAdvice ) {
public RequestResponseBodyAdviceChain ( List < Object > requestResponseBodyAdvice ) {
initAdvice ( requestResponseBodyAdvice ) ;
initAdvice ( requestResponseBodyAdvice ) ;
@ -64,7 +65,7 @@ class RequestResponseBodyAdviceChain implements RequestBodyAdvice, ResponseBodyA
if ( RequestBodyAdvice . class . isAssignableFrom ( beanType ) ) {
if ( RequestBodyAdvice . class . isAssignableFrom ( beanType ) ) {
this . requestBodyAdvice . add ( advice ) ;
this . requestBodyAdvice . add ( advice ) ;
}
}
else if ( ResponseBodyAdvice . class . isAssignableFrom ( beanType ) ) {
if ( ResponseBodyAdvice . class . isAssignableFrom ( beanType ) ) {
this . responseBodyAdvice . add ( advice ) ;
this . responseBodyAdvice . add ( advice ) ;
}
}
}
}