public class JavaInvokeOperations extends Object
JavaModule related to invocation of class or instance methods using reflection.| Constructor and Description |
|---|
JavaInvokeOperations() |
| Modifier and Type | Method and Description |
|---|---|
Object |
invoke(MethodIdentifier identifier,
Object instance,
Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args)
Operation that allows the user to invoke methods with the provided
args on the given instance. |
Object |
invokeStatic(StaticMethodIdentifier identifier,
Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args)
Operation that allows the user to invoke static methods with the provided arguments.
|
@Throws(value=JavaInvokeErrorProvider.class) @OutputResolver(output=StaticMethodTypeResolver.class) public Object invokeStatic(@ParameterGroup(name="Method") @MetadataKeyId(value=StaticMethodTypeResolver.class) StaticMethodIdentifier identifier, @Optional @NullSafe @Content @TypeResolver(value=StaticMethodTypeResolver.class) Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args) throws ClassNotFoundModuleException, ArgumentMismatchModuleException, InvocationModuleException, NoSuchMethodModuleException
Method to be invoked includes the class and method names,
being the method a full description of its signature including the types of each parameter.
For example, if we want to invoke the static method echo with signature public static String echo(String msg)
which belongs to Class org.bar.Foo, then the identifier of the method will be "echo(String)"
identifier - the unique identifier for the method to be invoked.args - the arguments used to invoke the given MethodMethod invocation with the given argsClassNotFoundModuleException - if the given class is not found in the current contextNoSuchMethodModuleException - if the given class does not declare a method with the given signatureArgumentMismatchModuleException - if the method requires a different set of arguments than the ones providedInvocationModuleException - if an error occurs during the execution of the method@Throws(value=JavaInvokeErrorProvider.class) @OutputResolver(output=InstanceMethodTypeResolver.class) public Object invoke(@ParameterGroup(name="Method") @MetadataKeyId(value=InstanceMethodTypeResolver.class) MethodIdentifier identifier, Object instance, @Optional @NullSafe @Content @TypeResolver(value=InstanceMethodTypeResolver.class) Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args) throws ClassNotFoundModuleException, WrongTypeModuleException, ArgumentMismatchModuleException, InvocationModuleException, NoSuchMethodModuleException
args on the given instance.
The identifier of the Method to be invoked includes the class and method names,
being the method a full description of its signature including the types of each parameter.
For example, if we want to invoke the method echo with signature public String echo(String msg)
which belongs to Class org.bar.Foo, then the identifier of the method will be "echo(String)"
identifier - the unique identifier for the method to be invokedinstance - the instance on which the method will be invokedargs - the arguments used to invoke the given MethodMethod invocation with the given argsClassNotFoundModuleException - if the given class is not found in the current contextNoSuchMethodModuleException - if the given class does not declare a method with the given signatureArgumentMismatchModuleException - if the method requires a different set of arguments than the ones providedWrongTypeModuleException - if the given instance is not an instance of the expected classInvocationModuleException - if an error occurs during the execution of the methodCopyright © 2018 MuleSoft, Inc.. All rights reserved.