Class ReflectiveMethod
java.lang.Object
org.springframework.data.jpa.util.ReflectiveMethod
A method resolved by name for reflective invocation.
Resolution prefers a public interface declaring the method over the implementation type. Implementation types may live in internal packages without being public, so invoking the interface method avoids making internal members accessible.
Intended for internal use only.
- Since:
- 4.2
- Author:
- Oscar Fanchin, Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ReflectiveMethodfind(Class<?> type, String methodName, ReflectionUtils.MethodFilter filter) Find the method namedmethodNameontypethat matchesfilter.static ReflectiveMethodResolve the method namedmethodNameontyperegardless of its parameters.static ReflectiveMethodResolve the method namedmethodNameontypeaccepting exactlyparameterTypes.static ReflectiveMethodget(Class<?> type, String methodName, ReflectionUtils.MethodFilter filter) Resolve the method namedmethodNameontypethat matchesfilter.Class<?> Type on which the method was looked up.Class<?> Invoke the method ontarget, rethrowing target exceptions asReflectionUtils.invokeMethod(Method, Object, Object...)does.toString()
-
Method Details
-
get
Resolve the method namedmethodNameontyperegardless of its parameters.- Throws:
IllegalStateException- if no such method exists.
-
get
Resolve the method namedmethodNameontypeaccepting exactlyparameterTypes.- Throws:
IllegalStateException- if no such method exists.
-
get
public static ReflectiveMethod get(Class<?> type, String methodName, ReflectionUtils.MethodFilter filter) Resolve the method namedmethodNameontypethat matchesfilter.- Throws:
IllegalStateException- if no such method exists.- See Also:
-
find
public static @Nullable ReflectiveMethod find(Class<?> type, String methodName, ReflectionUtils.MethodFilter filter) Find the method namedmethodNameontypethat matchesfilter.- Returns:
- the resolved method, or null if none matches.
-
getLookupType
Type on which the method was looked up.- Returns:
- the type on which the method was looked up.
-
getMethodName
-
getReturnType
-
invoke
-
toString
-