Interface MemberInvoker
- All Known Implementing Classes:
DefaultMemberInvoker
public interface MemberInvoker
Abstraction for invoking a
Member (e.g. Method,
Constructor, or Field) reflectively.
This interface provides a uniform API to invoke members on a target object with zero or more parameters.
See DefaultMemberInvoker for the main implementation which uses high-performance invocation strategies using
method handles and lambdas as opposed to traditional Java reflection resulting in near-native invocation performance.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectInvokes the member with no parameters.invoke(Object target, int parameterCount, IntFunction<?> parameterProvider) Invokes the member with the provided number of parameters using a parameter provider.default ObjectInvokes the member with a single parameter.default ObjectInvokes the member with a variable number of parameters.
-
Method Details
-
invoke
-
invoke
-
invoke
-
invoke
Invokes the member with the provided number of parameters using a parameter provider.- Parameters:
target- the target objectparameterCount- the number of parameters to useparameterProvider- a function to supply parameters by index- Returns:
- the invocation result
-
getMember
Member getMember()- Returns:
- the underlying reflective member
-