spring-framework / org.springframework.beans / BeanUtils / resolveSignature

resolveSignature

@Nullable open static fun resolveSignature(signature: String, clazz: Class<*>): Method

Parse a method signature in the form methodName[([arg_list])], where arg_list is an optional, comma-separated list of fully-qualified type names, and attempts to resolve that signature against the supplied Class.

When not supplying an argument list (methodName) the method whose name matches and has the least number of parameters will be returned. When supplying an argument type list, only the method whose name and argument types match will be returned.

Note then that methodName and methodName() are not resolved in the same way. The signature methodName means the method called methodName with the least number of arguments, whereas methodName() means the method called methodName with exactly 0 arguments.

If no method can be found, then null is returned.

Parameters

signature - the method signature as String representation

clazz - the class to resolve the method signature against

Return
the resolved Method

See Also
#findMethod#findMethodWithMinimalParameters