public class DefaultObjectBuilder<T> extends Object
ObjectBuilder
which
creates instances through a provided Class
.Constructor and Description |
---|
DefaultObjectBuilder(Class<T> prototypeClass)
Creates a new instance that will build instances of
prototypeClass . |
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.
|
protected T |
instantiateObject()
Creates a new instance by calling the default constructor on
prototypeClass
Returns the instance to be returned before the properties have
been applied to it |
boolean |
isDynamic()
Whether any of the registered
ValueResolver s are dynamic |
protected T instantiateObject()
prototypeClass
Returns the instance to be returned before the properties have
been applied to itpublic ObjectBuilder<T> addPropertyResolver(Field field, ValueResolver<? extends Object> resolver)
ValueResolver
addPropertyResolver
in interface ObjectBuilder<T>
field
- the Field
in which the value is to be assignedresolver
- a ValueResolver
used to provide the actual valuepublic boolean isDynamic()
ValueResolver
s are dynamicisDynamic
in interface ObjectBuilder<T>
true
if at least one resolver is dynamic. false
otherwisepublic T build(MuleEvent event) throws MuleException
MuleEvent
will be used to obtain a
value from each registered ValueResolver
build
in interface ObjectBuilder<T>
event
- a MuleEvent
MuleException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.