Package org.springframework.data.util
Class NullnessMethodInvocationValidator
java.lang.Object
org.springframework.data.util.NullnessMethodInvocationValidator
- All Implemented Interfaces:
- Advice,- Interceptor,- MethodInterceptor
- Direct Known Subclasses:
- MethodInvocationValidator
Interceptor enforcing required return value and method parameter constraints declared on repository query methods.
 Supports Kotlin nullness markers and JSR-305 Non-null annotations. Originally implemented via
 
MethodInvocationValidator.- Since:
- 3.5
- Author:
- Mark Paluch, Johannes Englmeier, Christoph Strobl
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected RuntimeExceptionargumentIsNull(Method method, String parameterName) Template method to construct aRuntimeExceptionindicating failure to provide a non-null value for a method parameter.invoke(MethodInvocation invocation) protected RuntimeExceptionreturnValueIsNull(Method method) Template method to construct aRuntimeExceptionindicating failure to return a non-null return value.static booleanReturns true if thetypeis supported by this interceptor.
- 
Constructor Details- 
NullnessMethodInvocationValidatorpublic NullnessMethodInvocationValidator()
 
- 
- 
Method Details- 
supportsReturns true if thetypeis supported by this interceptor.- Parameters:
- type- the interface class.
- Returns:
- true if the typeis supported by this interceptor.
 
- 
invoke- Specified by:
- invokein interface- MethodInterceptor
- Throws:
- Throwable
 
- 
argumentIsNullTemplate method to construct aRuntimeExceptionindicating failure to provide a non-null value for a method parameter.- Parameters:
- method-
- parameterName-
- Returns:
 
- 
returnValueIsNullTemplate method to construct aRuntimeExceptionindicating failure to return a non-null return value.- Parameters:
- method-
- Returns:
 
 
-