Package io.micronaut.core.bind
Class DefaultExecutableBinder<S>
- java.lang.Object
-
- io.micronaut.core.bind.DefaultExecutableBinder<S>
-
- Type Parameters:
S
- The source type
- All Implemented Interfaces:
ExecutableBinder<S>
public class DefaultExecutableBinder<S> extends java.lang.Object implements ExecutableBinder<S>
Default implementation of theExecutableBinder
interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultExecutableBinder()
Default constructor.DefaultExecutableBinder(java.util.Map<Argument<?>,java.lang.Object> preBound)
A map of pre-bound values for any arguments that don't need to be dynamically bound.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T,R>
BoundExecutable<T,R>bind(Executable<T,R> target, ArgumentBinderRegistry<S> registry, S source)
Binds a givenExecutable
using the given registry and source object.<T,R>
BoundExecutable<T,R>tryBind(Executable<T,R> target, ArgumentBinderRegistry<S> registry, S source)
Binds a givenExecutable
using the given registry and source object.
-
-
-
Method Detail
-
bind
public <T,R> BoundExecutable<T,R> bind(Executable<T,R> target, ArgumentBinderRegistry<S> registry, S source) throws UnsatisfiedArgumentException
Description copied from interface:ExecutableBinder
Binds a givenExecutable
using the given registry and source object.- Specified by:
bind
in interfaceExecutableBinder<S>
- 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<S> registry, S 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<S>
- 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
-
-