@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2018 the original author or authors .
* Copyright 2002 - 2019 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -46,16 +46,16 @@ import org.springframework.stereotype.Component;
@@ -46,16 +46,16 @@ import org.springframework.stereotype.Component;
* < p > Note : For { @code @ExceptionHandler } methods , a root exception match will be
* preferred to just matching a cause of the current exception , among the handler
* methods of a particular advice bean . However , a cause match on a higher - priority
* advice will still be preferred to a any match ( whether root or cause level )
* advice will still be preferred over any match ( whether root or cause level )
* on a lower - priority advice bean . As a consequence , please declare your primary
* root exception mappings on a prioritized advice bean with a corresponding order !
* root exception mappings on a prioritized advice bean with a corresponding order .
*
* < p > By default the methods in an { @code @ControllerAdvice } apply globally to
* all C ontrollers. Use selectors { @link # annotations ( ) } ,
* { @link # basePackageClasses ( ) } , and { @link # basePackages ( ) } ( or its alias
* { @link # value ( ) } ) to define a more narrow subset of targeted C ontrollers.
* If multiple selectors are declared , OR logic is applied , meaning selected
* C ontrollers should match at least one selector . Note that selector checks
* < p > By default , the methods in an { @code @ControllerAdvice } apply globally to
* all c ontrollers. Use selectors { @link # annotations } ,
* { @link # basePackageClasses } , and { @link # basePackages } ( or its alias
* { @link # value } ) to define a more narrow subset of targeted c ontrollers.
* If multiple selectors are declared , boolean { @code OR } logic is applied , meaning
* selected c ontrollers should match at least one selector . Note that selector checks
* are performed at runtime and so adding many selectors may negatively impact
* performance and add complexity .
*
@ -98,8 +98,8 @@ public @interface ControllerAdvice {
@@ -98,8 +98,8 @@ public @interface ControllerAdvice {
String [ ] basePackages ( ) default { } ;
/ * *
* Type - safe alternative to { @link # value ( ) } for specifying the packages
* to select Controllers to be assist ed by the { @code @ControllerAdvice }
* Type - safe alternative to { @link # basePackages } for specifying the packages
* in which to select controllers to be advis ed by the { @code @ControllerAdvice }
* annotated class .
* < p > Consider creating a special no - op marker class or interface in each package
* that serves no purpose other than being referenced by this attribute .
@ -110,16 +110,16 @@ public @interface ControllerAdvice {
@@ -110,16 +110,16 @@ public @interface ControllerAdvice {
/ * *
* Array of classes .
* < p > Controllers that are assignable to at least one of the given types
* will be assist ed by the { @code @ControllerAdvice } annotated class .
* will be advis ed by the { @code @ControllerAdvice } annotated class .
* @since 4 . 0
* /
Class < ? > [ ] assignableTypes ( ) default { } ;
/ * *
* Array of annotations .
* < p > Controllers that are annotated with this / one of those annotation ( s )
* will be assist ed by the { @code @ControllerAdvice } annotated class .
* < p > Consider creating a special annotation or use a predefined one ,
* < p > Controllers that are annotated with at least one of the supplied annotations
* will be advis ed by the { @code @ControllerAdvice } annotated class .
* < p > Consider creating a custom composed annotation or use a predefined one ,
* like { @link RestController @RestController } .
* @since 4 . 0
* /