T - the generic type of the produced values.public class NullSafeValueResolverWrapper<T> extends Object implements ValueResolver<T>, org.mule.runtime.api.lifecycle.Initialisable
ValueResolver wrapper which generates and returns default instances if the delegate returns null.
The values are generated according to the rules described in NullSafe.
Instances are to be obtained through the
of(ValueResolver, MetadataType, ReflectionCache, ExpressionManager, MuleContext, ObjectTypeParametersResolver) )} )}
factory method
| Modifier and Type | Method and Description |
|---|---|
void |
initialise() |
boolean |
isDynamic()
Returns
false if subsequent invocations to ValueResolver.resolve(ValueResolvingContext) will return the same value. |
static <T> ValueResolver<T> |
of(ValueResolver<T> delegate,
org.mule.metadata.api.model.MetadataType type,
ReflectionCache reflectionCache,
ExpressionManager expressionManager,
MuleContext muleContext,
ObjectTypeParametersResolver parametersResolver)
Creates a new instance
|
T |
resolve(ValueResolvingContext context)
Resolves a value from the given
event |
public static <T> ValueResolver<T> of(ValueResolver<T> delegate, org.mule.metadata.api.model.MetadataType type, ReflectionCache reflectionCache, ExpressionManager expressionManager, MuleContext muleContext, ObjectTypeParametersResolver parametersResolver)
T - the generic type of the produced valuesdelegate - the ValueResolver to wraptype - the type of the value this resolver returnsreflectionCache - the cache for expensive reflection lookupsmuleContext - the current MuleContextValueResolverorg.mule.runtime.extension.api.exception.IllegalParameterModelDefinitionException - if used on parameters of not supported typespublic T resolve(ValueResolvingContext context) throws org.mule.runtime.api.exception.MuleException
ValueResolvereventresolve in interface ValueResolver<T>context - the context for the current resolution attemptorg.mule.runtime.api.exception.MuleException - if the resolution of the value failspublic boolean isDynamic()
ValueResolverfalse if subsequent invocations to ValueResolver.resolve(ValueResolvingContext) will return the same value.
Notice that if it returns true, then it might return different values per invocation but that's not guaranteed.isDynamic in interface ValueResolver<T>public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionCopyright © 2003–2019 MuleSoft, Inc.. All rights reserved.