public class ResolverSet extends Object implements ValueResolver<Object>
ValueResolver which is based on associating a set of
Parameters -> 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 Parameters 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() |
| Modifier and Type | Method and Description |
|---|---|
ResolverSet |
add(org.mule.extension.introspection.Parameter parameter,
ValueResolver resolver)
Links the given
ValueResolver to the given Parameter. |
Map<org.mule.extension.introspection.Parameter,ValueResolver> |
getResolvers() |
boolean |
isDynamic()
Whether at least one of the given
ValueResolver are dynamic |
ResolverSetResult |
resolve(MuleEvent event)
Evaluates all the added
ValueResolvers and returns the results into
a ResolverSetResult |
public ResolverSet add(org.mule.extension.introspection.Parameter parameter, ValueResolver resolver)
ValueResolver to the given Parameter.
If such parameter was already added, then the associated resolver
is replaced.
Since this class implements Lifecycle and MuleContextAware,
this method works in tandem with the ones defined in that interface.
All the lifecycle invocations received by this instances are propagates to the
registered resolvers. You should make a best effort then to add all the resolvers
before lifecycle is applied. Otherwise, adding more resolvers will be allowed
but you'll be in charge of whatever lifecycle phases it has missedparameter - a not null Parameterresolver - a not null ValueResolverIllegalArgumentException - is either parameter or resolver are nullpublic boolean isDynamic()
ValueResolver are dynamicisDynamic in interface ValueResolver<Object>true if at least one resolver is dynamic. false otherwisepublic ResolverSetResult resolve(MuleEvent event) throws MuleException
ValueResolvers and returns the results into
a ResolverSetResultresolve in interface ValueResolver<Object>event - a not null MuleEventResolverSetResultExceptionMuleExceptionpublic Map<org.mule.extension.introspection.Parameter,ValueResolver> getResolvers()
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.