T - public class TypeSafeExpressionValueResolver<T> extends Object implements ValueResolver<T>, org.mule.runtime.api.lifecycle.Initialisable
ValueResolver which evaluates expressions and tries to ensure that the output is always of a certain type.
If the expression does not return a value of that type, then it tries to locate a Transformer which can do the
transformation from the obtained type to the expected one.
It resolves the expressions by making use of the AttributeEvaluator so that it's compatible with simple expressions and
templates alike
| Constructor and Description |
|---|
TypeSafeExpressionValueResolver(String expression,
Class<T> expectedType,
org.mule.runtime.api.metadata.DataType expectedDataType) |
| Modifier and Type | Method and Description |
|---|---|
void |
initialise() |
boolean |
isDynamic()
Returns
false if subsequent invocations to ValueResolver.resolve(ValueResolvingContext) will return the same value. |
T |
resolve(ValueResolvingContext context)
Resolves a value from the given
event |
void |
setExtendedExpressionManager(ExtendedExpressionManager extendedExpressionManager) |
void |
setMelAvailable(Boolean melAvailable) |
void |
setMelDefault(Boolean melDefault) |
void |
setMuleContext(MuleContext muleContext) |
void |
setTransformationService(org.mule.runtime.api.transformation.TransformationService transformationService) |
public T resolve(ValueResolvingContext context) throws org.mule.runtime.api.exception.MuleException
ValueResolvereventresolve in interface ValueResolver<T>context - the context for the current resolution attemptorg.mule.runtime.api.exception.MuleException - if the resolution of the value failspublic boolean isDynamic()
ValueResolverfalse if subsequent invocations to ValueResolver.resolve(ValueResolvingContext) will return the same value.
Notice that if it returns true, then it might return different values per invocation but that's not guaranteed.isDynamic in interface ValueResolver<T>truepublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void setTransformationService(org.mule.runtime.api.transformation.TransformationService transformationService)
public void setExtendedExpressionManager(ExtendedExpressionManager extendedExpressionManager)
public void setMuleContext(MuleContext muleContext)
public void setMelDefault(Boolean melDefault)
public void setMelAvailable(Boolean melAvailable)
Copyright © 2003–2024 MuleSoft, Inc.. All rights reserved.