T
- public class TypeSafeExpressionValueResolver<T> extends Object implements ValueResolver<T>
ValueResolver
which evaluates a MEL expressions and tries
to ensure that the output is always of a certain type.
If the MEL 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 alikeConstructor and Description |
---|
TypeSafeExpressionValueResolver(String expression,
org.mule.extension.introspection.DataType expectedType) |
Modifier and Type | Method and Description |
---|---|
boolean |
isDynamic()
returns
false if subsequent invocations to
ValueResolver.resolve(MuleEvent) will return the same value. |
T |
resolve(MuleEvent event)
Resolves a value from the given
event |
public TypeSafeExpressionValueResolver(String expression, org.mule.extension.introspection.DataType expectedType)
public T resolve(MuleEvent event) throws MuleException
ValueResolver
event
resolve
in interface ValueResolver<T>
event
- a MuleEvent
MuleException
- if the resolution of the value failspublic boolean isDynamic()
ValueResolver
false
if subsequent invocations to
ValueResolver.resolve(MuleEvent)
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>
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.