Class ReflectionInjectorBuilder
java.lang.Object
honeyroasted.fill.reflect.ReflectionInjectorBuilder
- All Implemented Interfaces:
InjectorBuilder<ReflectionInjectorBuilder, ReflectionInjector>
public class ReflectionInjectorBuilder
extends Object
implements InjectorBuilder<ReflectionInjectorBuilder, ReflectionInjector>
An
InjectorBuilder for building ReflectionInjectors-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(ReflectionInjectorBuilder other) Appends all the bindings from the given builder to this builderAdds one or more bindings to this builderbuild()constructorAggregator(Function<Class<?>, Collection<Constructor<?>>> constructorAggregator) Sets the constructor aggregator for this builder.dummyObjectMatcher(BiPredicate<InjectionTarget, Object> matcher) Sets the dummy objet matcher for this builder.fieldAggregator(Function<Class<?>, Collection<Field>> fieldAggregator) Sets the field aggregator for this builder.methodAggregator(Function<Class<?>, Collection<Method>> methodAggregator) Sets the field method for this builder.typeSystem(honeyroasted.jype.system.JTypeSystem system) Sets theJTypeSystemto use for the resulting injector
-
Constructor Details
-
ReflectionInjectorBuilder
public ReflectionInjectorBuilder()
-
-
Method Details
-
append
Appends all the bindings from the given builder to this builder- Parameters:
other- The other builder- Returns:
- This, for method chaining
-
typeSystem
Sets theJTypeSystemto use for the resulting injector- Parameters:
system- The type system- Returns:
- This, for method chaining
-
dummyObjectMatcher
Sets the dummy objet matcher for this builder. By default, it is set to return true for any objet which is equal to the default field type for the givenInjectionTargetor is an instance ofDummyObject.- Parameters:
matcher- The new dummy objet matcher- Returns:
- This, for method chaining
-
fieldAggregator
public ReflectionInjectorBuilder fieldAggregator(Function<Class<?>, Collection<Field>> fieldAggregator) Sets the field aggregator for this builder. By default, it is set to return all fields which are annotated with an injection annotation.- Parameters:
fieldAggregator- The new field aggregator- Returns:
- This, for method chaining
-
methodAggregator
public ReflectionInjectorBuilder methodAggregator(Function<Class<?>, Collection<Method>> methodAggregator) Sets the field method for this builder. By default, it is set to return all methods which are annotated with an injection annotation.- Parameters:
methodAggregator- The new method aggregator- Returns:
- This, for method chaining
-
constructorAggregator
public ReflectionInjectorBuilder constructorAggregator(Function<Class<?>, Collection<Constructor<?>>> constructorAggregator) Sets the constructor aggregator for this builder. By default, it is set to return all constructors which are annotated with an injection annotation.- Parameters:
constructorAggregator- The new constructor aggregator- Returns:
- This, for method chaining
-
bind
Description copied from interface:InjectorBuilderAdds one or more bindings to this builder- Specified by:
bindin interfaceInjectorBuilder<ReflectionInjectorBuilder, ReflectionInjector>- Parameters:
bindings- The bindings to add- Returns:
- This, for method chaining
-
build
- Specified by:
buildin interfaceInjectorBuilder<ReflectionInjectorBuilder, ReflectionInjector>- Returns:
- A new
Injectorwith the bindings from thisInjectorBuilder
-