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 |
|---|---|
Throwable |
getRootCause(Throwable exception)
Function that provides a way to obtain the root cause of a given
Throwable. |
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 |
isCausedBy(Throwable exception,
String throwableType,
boolean includeSubtypes)
This Function returns
true if the given Throwable that matches
the specified class in the exception cause chain. |
boolean |
isInstanceOf(Object instance,
String clazz)
Function 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") @Summary(value="Fully qualified name of the Class you want to check against") 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 contextpublic Throwable getRootCause(Throwable exception)
Throwable.public boolean isCausedBy(Throwable exception, @Summary(value="Fully qualified name of the Class you want to check against") String throwableType, @Optional boolean includeSubtypes)
true if the given Throwable that matches
the specified class in the exception cause chain.
If acceptSubtypes is true, subclasses of the specified class will also match.exception - the Throwable to inspectthrowableType - fully qualified name of the Class you want to check againstincludeSubtypes - if true, subclasses of the specified class will also result in a matchCopyright © 2020 MuleSoft, Inc.. All rights reserved.