T - public class TypeSafeValueResolverWrapper<T> extends Object implements ValueResolver<T>, org.mule.runtime.api.lifecycle.Initialisable
ValueResolver wrapper implementation which wraps another ValueResolver and ensures that the output is always of
a certain type.
If the returned value of the this#valueResolverDelegate is not of the desired type, it tries to locate a
Transformer which can do the transformation from the obtained type to the expected one.
| Constructor and Description |
|---|
TypeSafeValueResolverWrapper(ValueResolver valueResolverDelegate,
Class<T> expectedType) |
| 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 |
setTransformationService(org.mule.runtime.api.transformation.TransformationService transformationService) |
public TypeSafeValueResolverWrapper(ValueResolver valueResolverDelegate, Class<T> expectedType)
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>public 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)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.