public class ResolverSet extends Object implements ValueResolver<ResolverSetResult>
ValueResolver
which is based on associating a set of
Parameter
s -> ValueResolver
pairs. The result
of evaluating this resolver is a ResolverSetResult
.
The general purpose of this class is to repeatedly evaluate a set of ValueResolver
s
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 Parameter
s and ValueResolver
s
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 reusableConstructor 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
ValueResolver s 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.parameter
- a not null
Parameter
resolver
- a not null
ValueResolver
IllegalArgumentException
- is either parameter
or resolver
are null
public boolean isDynamic()
ValueResolver
are dynamicisDynamic
in interface ValueResolver<ResolverSetResult>
true
if at least one resolver is dynamic. false
otherwisepublic ResolverSetResult resolve(MuleEvent event) throws MuleException
ValueResolver
s and returns the results into
a ResolverSetResult
resolve
in interface ValueResolver<ResolverSetResult>
event
- a not null
MuleEvent
ResolverSetResult
Exception
MuleException
- if the resolution of the value failspublic Map<org.mule.extension.introspection.Parameter,ValueResolver> getResolvers()
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.