public class ResolverSet extends Object implements ValueResolver<ResolverSetResult>, org.mule.runtime.api.lifecycle.Initialisable
ValueResolver which is based on associating a set of keys -> ValueResolver pairs. The result of evaluating
this resolver is a ResolverSetResult.
The general purpose of this class is to repeatedly evaluate a set of ValueResolvers which results are to be used in the
construction of an object, so that the structure of such can be described only once (by the set of keys and
ValueResolvers but evaluated many times. With this goal in mind is that the return value of this resolver will always
be a ResolverSetResult which then can be used by a ObjectBuilder to generate an actual object.
Instances of this class are to be considered thread safe and reusable
| Constructor and Description |
|---|
ResolverSet(MuleContext muleContext) |
| Modifier and Type | Method and Description |
|---|---|
ResolverSet |
add(String key,
ValueResolver resolver)
Links the given
ValueResolver to the given ParameterModel. |
Map<String,ValueResolver> |
getResolvers() |
void |
initialise() |
boolean |
isDynamic()
Whether at least one of the given
ValueResolver are dynamic |
ResolverSetResult |
resolve(ValueResolvingContext context)
Evaluates all the added
ValueResolvers and returns the results into a ResolverSetResult |
public ResolverSet(MuleContext muleContext)
public ResolverSet add(String key, ValueResolver resolver)
ValueResolver to the given ParameterModel. If such parameter was already added, then
the associated resolver is replaced.key - a not null ParameterModelresolver - a not null ValueResolverIllegalArgumentException - is either parameter or resolver are nullpublic boolean isDynamic()
ValueResolver are dynamicisDynamic in interface ValueResolver<ResolverSetResult>true if at least one resolver is dynamic. false otherwisepublic ResolverSetResult resolve(ValueResolvingContext context) throws org.mule.runtime.api.exception.MuleException
ValueResolvers and returns the results into a ResolverSetResultresolve in interface ValueResolver<ResolverSetResult>context - a not null ValueResolvingContextResolverSetResultorg.mule.runtime.api.exception.MuleException - if an error occurs creating the ResolverSetResultpublic Map<String,ValueResolver> getResolvers()
public void initialise()
initialise in interface org.mule.runtime.api.lifecycle.InitialisableCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.