public class ParameterTransformer extends Object
Executable
When transforming an input into something that fits to an Executable's parameter, this class will make a best effort in
order to make this transformation possible. In case that the transformation requires to transform a Collection or
Map, a new instance will be created for it.| Constructor and Description |
|---|
ParameterTransformer(Executable executable,
org.mule.runtime.api.transformation.TransformationService transformationService,
org.mule.runtime.core.api.el.ExpressionManager expressionManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
parameterNeedsTransformation(Object value,
int parameterIndex)
Method that allows to check if a value fits a certain argument of the executable.
|
Optional<Object> |
transformParameter(Object value,
int parameterIndex)
Method that makes a best efford to map an object to the type of a parameter of the excecutable.
|
public ParameterTransformer(Executable executable, org.mule.runtime.api.transformation.TransformationService transformationService, org.mule.runtime.core.api.el.ExpressionManager expressionManager)
executable - The executable whose parameters will be checked against Objects.transformationService - An instance of a TransformationService use to tranform parameters.expressionManager - An instance of a ExpressionManager used to execute DataWeave expressions.public boolean parameterNeedsTransformation(Object value, int parameterIndex)
Map and Collection values.value - The value which type will be checked.parameterIndex - The index of the parameter in the executable arguments.public Optional<Object> transformParameter(Object value, int parameterIndex)
Map and
Collection will be replaced with new instances. Other object will remain the same instance if they do not need to be
transformed. For example, if a list is transformed, a new list will be created and will contain the same instances from the
former list that did not needed to be transformed and new instances for the ones being transformed.value - The value that will be transformed.parameterIndex - The index of the parameter in the executable arguments.Copyright © 2025 MuleSoft, Inc.. All rights reserved.