public final class

MethodInvocationUtils

extends Object
java.lang.Object
   ↳ org.springframework.security.util.MethodInvocationUtils

Class Overview

Static utility methods for creating MethodInvocations usable within Spring Security.

All methods of this class return a SimpleMethodInvocation.

Summary

Public Constructors
MethodInvocationUtils()
Public Methods
static MethodInvocation create(Object object, String methodName, Object... args)
Generates a MethodInvocation for specified methodName on the passed object, using the args to locate the method.
static MethodInvocation createFromClass(Object targetObject, Class<?> clazz, String methodName, Class[]<?> classArgs, Object[] args)
Generates a MethodInvocation for specified methodName on the passed class, using the args to locate the method.
static MethodInvocation createFromClass(Class<?> clazz, String methodName)
Generates a MethodInvocation for the specified methodName on the passed class.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MethodInvocationUtils ()

Public Methods

public static MethodInvocation create (Object object, String methodName, Object... args)

Generates a MethodInvocation for specified methodName on the passed object, using the args to locate the method.

Parameters
object the object that will be used to find the relevant Method
methodName the name of the method to find
args arguments that are required as part of the method signature (can be empty)
Returns
  • a MethodInvocation, or null if there was a problem

public static MethodInvocation createFromClass (Object targetObject, Class<?> clazz, String methodName, Class[]<?> classArgs, Object[] args)

Generates a MethodInvocation for specified methodName on the passed class, using the args to locate the method.

Parameters
targetObject the object being invoked
clazz the class of object that will be used to find the relevant Method
methodName the name of the method to find
classArgs arguments that are required to locate the relevant method signature
args the actual arguments that should be passed to SimpleMethodInvocation
Returns
  • a MethodInvocation, or null if there was a problem

public static MethodInvocation createFromClass (Class<?> clazz, String methodName)

Generates a MethodInvocation for the specified methodName on the passed class. If a method with this name, taking no arguments does not exist, it will check through the declared methods on the class, until one is found matching the supplied name. If more than one method name matches, an IllegalArgumentException will be raised.

Parameters
clazz the class of object that will be used to find the relevant Method
methodName the name of the method to find
Returns
  • a MethodInvocation, or null if there was a problem