Interface MethodInvoker
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Method Invoker Interface
方法调用器接口
Provides a way to invoke the original method from an interceptor.
提供从拦截器调用原始方法的方式。
Features | 主要功能:
- Original method invocation from interceptor - 从拦截器调用原始方法
- No-op and constant factory methods - 空操作和常量工厂方法
Usage Examples | 使用示例:
// Used inside MethodInterceptor
MethodInterceptor interceptor = (proxy, method, args, invoker) -> {
// invoke the original method
return invoker.invoke(args);
};
Security | 安全性:
- Thread-safe: Depends on implementation - 线程安全: 取决于实现
- Null-safe: No (args may be null for no-arg methods) - 空值安全: 否(无参方法的args可能为null)
- Since:
- JDK 25, opencode-base-reflect V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic MethodInvokerCreates an invoker that always returns a constant 创建一个总是返回常量的调用器Invokes the original method 调用原始方法static MethodInvokernoOp()Creates a no-op invoker that returns null 创建一个返回null的空操作调用器
-
Method Details
-
invoke
-
noOp
Creates a no-op invoker that returns null 创建一个返回null的空操作调用器- Returns:
- the no-op invoker | 空操作调用器
-
constant
Creates an invoker that always returns a constant 创建一个总是返回常量的调用器- Parameters:
value- the value to return | 要返回的值- Returns:
- the constant invoker | 常量调用器
-