public final class GroupValueSetter extends Object implements ValueSetter
ValueSetter
for parameter groups.
Parameter groups are a set of parameters defined inside a Pojo in order to reference them
as a group and avoid code repetition. The parameter groups are defined by applying
the ParameterGroup
annotation to a field.
This ValueSetter
knows how to map a ResolverSetResult
to an object
which acts as a group. Because group nesting is allowed, this class is a composite
with a childSetters
collection.Constructor and Description |
---|
GroupValueSetter(ParameterGroup group)
Creates a new instance that can set values defined in the given
group |
Modifier and Type | Method and Description |
---|---|
void |
set(Object target,
ResolverSetResult result)
Sets on
target values contained in result . |
static List<ValueSetter> |
settersFor(org.mule.extension.introspection.Capable capable)
Returns a
List containing one ValueSetter instance per each
ParameterGroup defined in the ParameterGroupCapability extracted
from the given capable . |
public GroupValueSetter(ParameterGroup group)
group
group
- a ParameterGroup
public static List<ValueSetter> settersFor(org.mule.extension.introspection.Capable capable)
List
containing one ValueSetter
instance per each
ParameterGroup
defined in the ParameterGroupCapability
extracted
from the given capable
. If capable
does not contain such capability
then an empty List
is returnedcapable
- a Capable
instance presumed to have the ParameterGroupCapability
List
with ValueSetter
instances. May be empty but will never be null
public void set(Object target, ResolverSetResult result) throws MuleException
ValueSetter
target
values contained in result
. This method
does not guarantee how many of the values contained in result
are
actually assigned (if any). Implementations are free to decide using
only a sub set of those values or none at allset
in interface ValueSetter
target
- the object on which values are to be setresult
- a ResolverSetResult
MuleException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.