Package io.micronaut.context.bind
Class DefaultExecutableBeanContextBinder
java.lang.Object
io.micronaut.context.bind.DefaultExecutableBeanContextBinder
- All Implemented Interfaces:
ExecutableBeanContextBinder
,ExecutableBinder<BeanContext>
public final class DefaultExecutableBeanContextBinder
extends Object
implements ExecutableBeanContextBinder
Implementation of
ExecutableBeanContextBinder
.- Since:
- 4.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T,
R> BoundExecutable<T, R> bind
(Executable<T, R> target, BeanContext source) Binds a givenExecutable
using the given registry and source object.<T,
R> BoundExecutable<T, R> bind
(Executable<T, R> target, ArgumentBinderRegistry<BeanContext> registry, BeanContext source) Binds a givenExecutable
using the given registry and source object.<T,
R> BoundExecutable<T, R> tryBind
(Executable<T, R> target, ArgumentBinderRegistry<BeanContext> registry, BeanContext source) Binds a givenExecutable
using the given registry and source object.
-
Constructor Details
-
DefaultExecutableBeanContextBinder
public DefaultExecutableBeanContextBinder()
-
-
Method Details
-
bind
public <T,R> BoundExecutable<T,R> bind(Executable<T, R> target, ArgumentBinderRegistry<BeanContext> registry, BeanContext source) throws UnsatisfiedArgumentExceptionDescription copied from interface:ExecutableBinder
Binds a givenExecutable
using the given registry and source object.- Specified by:
bind
in interfaceExecutableBinder<BeanContext>
- Type Parameters:
T
- The executable target typeR
- The executable return type- Parameters:
target
- The target executableregistry
- The registry to usesource
- The binding source- Returns:
- The bound executable
- Throws:
UnsatisfiedArgumentException
- When the executable could not be satisfied
-
tryBind
public <T,R> BoundExecutable<T,R> tryBind(Executable<T, R> target, ArgumentBinderRegistry<BeanContext> registry, BeanContext source) Description copied from interface:ExecutableBinder
Binds a givenExecutable
using the given registry and source object. UnlikeExecutableBinder.bind(Executable, ArgumentBinderRegistry, Object)
this method will not throw anUnsatisfiedArgumentException
if an argument cannot be bound. Instead, theBoundExecutable.getUnboundArguments()
property will be populated with any arguments that could not be bound- Specified by:
tryBind
in interfaceExecutableBinder<BeanContext>
- Type Parameters:
T
- The executable target typeR
- The executable return type- Parameters:
target
- The target executableregistry
- The registry to usesource
- The binding source- Returns:
- The bound executable
-
bind
public <T,R> BoundExecutable<T,R> bind(Executable<T, R> target, BeanContext source) throws UnsatisfiedArgumentExceptionDescription copied from interface:ExecutableBeanContextBinder
Binds a givenExecutable
using the given registry and source object.- Specified by:
bind
in interfaceExecutableBeanContextBinder
- Type Parameters:
T
- The executable target typeR
- The executable return type- Parameters:
target
- The target executablesource
- The bean context- Returns:
- The bound executable
- Throws:
UnsatisfiedArgumentException
- When the executable could not be satisfied
-