public class JavaModuleFunctions extends Object
ExpressionFunctions exposed by the JavaModule that extends the EL
with further Java related functions.| Constructor and Description |
|---|
JavaModuleFunctions() |
| Modifier and Type | Method and Description |
|---|---|
Object |
invoke(String clazz,
String methodName,
Object instance,
Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args)
Function that allows the user to invoke methods with the provided
args on the given instance. |
boolean |
isInstanceOf(Object instance,
String clazz)
Operation that allows the user to check that a given
instance is an instanceof the specified class. |
public Object invoke(@Alias(value="class") @Summary(value="Fully qualified name of the Class containing the referenced Method") String clazz, @Alias(value="method") @Summary(value="Represents the Method signature containing the method name and it\'s argument types.") String methodName, Object instance, @Optional Map<String,org.mule.runtime.api.metadata.TypedValue<Object>> args) throws NoSuchMethodModuleException, ClassNotFoundModuleException, WrongTypeModuleException, ArgumentMismatchModuleException, InvocationModuleException
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)"
clazz - the fully qualified name of the class whose instance is being injectedmethodName - 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 methodpublic boolean isInstanceOf(Object instance, @Alias(value="class") String clazz) throws ClassNotFoundModuleException
instance is an instanceof the specified class.clazz - the fully qualified name of the expected Class for the instanceinstance - the object whose type is expected to be an instanceof of the given classClassNotFoundModuleException - if the given class is not found in the current contextCopyright © 2018 MuleSoft, Inc.. All rights reserved.