String
Java Module Reference - Mule 4
Operations
Invoke
<java:invoke>
Invoke methods with the provided arguments in an instance. The identifier of the method to invoke includes the class and method names, being the method a full description of its signature including the types of each parameter.
For example, to invoke the echo
method with the signature public String echo(String msg)
that belongs to Class org.bar.Me
, then the identifier of the method is echo(String)
.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Instance |
Any |
The instance on which the method is invoked. |
x |
|
Args |
Object |
The arguments used to invoke a method. |
||
Class |
String |
Represents the fully qualified name of the class containing the referenced method. |
x |
|
Method |
String |
Represents the method signature containing the method name and its argument types. For example, for the method with signature, |
x |
|
Target Variable |
String |
The name of a variable in which to place the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output, and to store the outcome of that expression in the target variable. |
#[payload] |
Invoke Static
<java:invoke-static>
Operation that allows the user to invoke static methods with the provided arguments. 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, to invoke the static method echo
with signature public static String echo(String msg)
that belongs to Class org.bar.Me
, then the identifier of the method is echo(String)
.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Args |
Object |
The arguments used to invoke the given Method. |
||
Class |
String |
Represents the fully qualified name of the Class containing the referenced Method. |
x |
|
Method |
String |
Represents the Method signature containing the method name and its argument types. For example, for the method with signature |
x |
|
Target Variable |
String |
The name of a variable in which to place the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output, and to store the outcome of that expression in the target variable. |
#[payload] |
New
<java:new>
Create a new instance of a class.
The identifier of a Constructor includes the class and constructor names, and the constructor has a full description of its signature including the types of each parameter.
For example, to invoke the constructor Me(String name, int age)
which belongs to the org.bar.Me
class, then the identifier of the method is Me(String,int)
.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Args |
Object |
The arguments used to invoke the given Constructor |
||
Class |
String |
Represents the fully qualified name of the Class containing the referenced Method. |
x |
|
Constructor |
String |
Represents the Constructor signature that contains the name and its argument types. For example, for the Constructor with the |
x |
|
Target Variable |
String |
The name of a variable in which to place the operation’s output. |
||
Target Value |
String |
An expression to evaluate against the operation’s output, and to store the outcome of that expression in the target variable. |
#[payload] |
Validate Type
<java:validate-type>
Validate that an instance is an instanceof
a class.