K,V - the generic type for the items of the returned Mappublic final class MapValueResolver<K,V> extends Object implements ValueResolver<Map<K,V>>, org.mule.runtime.api.lifecycle.Initialisable
ValueResolver that takes a list of ValueResolvers and upon invocation of resolve(ValueResolvingContext) it return a
Map of values with the outcome of each original resolver.
This class implements Lifecycle and propagates those events to each of the resolvers| Constructor and Description |
|---|
MapValueResolver(Class<? extends Map> mapType,
List<ValueResolver<K>> keyResolvers,
List<ValueResolver<V>> valueResolvers,
ReflectionCache reflectionCache,
MuleContext muleContext)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
List<ValueResolver<K>> |
getKeyResolvers() |
List<ValueResolver<V>> |
getValueResolvers() |
void |
initialise() |
boolean |
isDynamic()
Returns
false if subsequent invocations to ValueResolver.resolve(ValueResolvingContext) will return the same value. |
static <K,V> MapValueResolver<K,V> |
of(Class<? extends Map> mapType,
List<ValueResolver<K>> keyResolvers,
List<ValueResolver<V>> valueResolvers,
ReflectionCache reflectionCache,
MuleContext muleContext) |
Map<K,V> |
resolve(ValueResolvingContext context)
Passes the given
context to each resolvers and outputs a map of type mapType with each result |
public MapValueResolver(Class<? extends Map> mapType, List<ValueResolver<K>> keyResolvers, List<ValueResolver<V>> valueResolvers, ReflectionCache reflectionCache, MuleContext muleContext)
mapType - the Class for a concrete Map type with a default constructorkeyResolvers - a not null List of resolvers for map key paramsvalueResolvers - a not null List of resolvers for map value paramsmuleContext - the artifact MuleContext that will be used for initialisation of resolverspublic static <K,V> MapValueResolver<K,V> of(Class<? extends Map> mapType, List<ValueResolver<K>> keyResolvers, List<ValueResolver<V>> valueResolvers, ReflectionCache reflectionCache, MuleContext muleContext)
public Map<K,V> resolve(ValueResolvingContext context) throws org.mule.runtime.api.exception.MuleException
context to each resolvers and outputs a map of type mapType with each resultresolve in interface ValueResolver<Map<K,V>>context - a ValueResolvingContext the context to evaluateMap of type mapTypeorg.mule.runtime.api.exception.MuleExceptionpublic 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<Map<K,V>>true if at least one of the resolvers are dynamicpublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic List<ValueResolver<K>> getKeyResolvers()
public List<ValueResolver<V>> getValueResolvers()
Copyright © 2003–2024 MuleSoft, Inc.. All rights reserved.