public interface ObjectBuilder<T>
Class
, populating its attributes
based on a list of ValueResolver
s.
The built object's class must comply with the following
requirements:
build(MuleEvent)
method can be invoked
several times on the same instance. Each time build(MuleEvent)
is invoked, the resolvers will be re evaluated with the given event.Modifier and Type | Method and Description |
---|---|
ObjectBuilder<T> |
addPropertyResolver(Field field,
ValueResolver<? extends Object> resolver)
Adds a property which value is to be obtained from
a
ValueResolver |
T |
build(MuleEvent event)
Returns a new instance of the specified class.
|
boolean |
isDynamic()
Whether any of the registered
ValueResolver s are dynamic |
ObjectBuilder<T> addPropertyResolver(Field field, ValueResolver<? extends Object> resolver)
ValueResolver
field
- the Field
in which the value is to be assignedresolver
- a ValueResolver
used to provide the actual value{@link
- java.lang.IllegalArgumentException} if method or resolver are null
boolean isDynamic()
ValueResolver
s are dynamictrue
if at least one resolver is dynamic. false
otherwiseT build(MuleEvent event) throws MuleException
MuleEvent
will be used to obtain a
value from each registered ValueResolver
event
- a MuleEvent
{@link
- MuleException}MuleException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.