public class DefaultObjectBuilder<T> extends Object implements ObjectBuilder<T>
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(String propertyName,
ValueResolver<? extends Object> resolver)
Adds a property which value is to be obtained from a
ValueResolver |
T |
build(Event event)
Returns a new instance of the specified class.
|
boolean |
isDynamic()
Whether any of the registered
ValueResolvers are dynamic |
public ObjectBuilder<T> addPropertyResolver(String propertyName, ValueResolver<? extends Object> resolver)
ValueResolverpropertyName - the name of the property 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 nullpublic boolean isDynamic()
ValueResolvers are dynamicisDynamic in interface ObjectBuilder<T>true if at least one resolver is dynamic. false otherwisepublic T build(Event event) throws org.mule.runtime.api.exception.MuleException
Event will be used to obtain a value from each registered
ValueResolverbuild in interface ObjectBuilder<T>event - a Eventorg.mule.runtime.api.exception.MuleExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.