Index
All Classes|All Packages
A
- addBinding() - Method in interface io.github.pustike.inject.bind.MultiBinder
-
Returns the
LinkedBindingBuilder
used to add a new element into the list. - addBindingListener(Predicate<Class<?>>, BindingListener) - Method in interface io.github.pustike.inject.bind.Binder
-
Registers a binding listener which will be notified during injector configuration, if matched by the given type matcher, after the targetClass binding is registered to the injector.
- addInjectionListener(Predicate<Class<?>>, InjectionListener) - Method in interface io.github.pustike.inject.bind.Binder
-
Registers an injection listener which will be notified after dependencies are injected into a newly provisioned instance, if target class is matched by the given type matcher.
- afterBinding(BindingKey<?>, Class<?>) - Method in interface io.github.pustike.inject.spi.BindingListener
-
Called after the targetClass binding to the key as specified in the module is registered to the injector.
- afterInjection(BindingKey<?>, Object) - Method in interface io.github.pustike.inject.spi.InjectionListener
-
Invoked after fields and methods of the instance ar injected by the injector.
- AnnotatedBindingBuilder<T> - Interface in io.github.pustike.inject.bind
-
A binding builder, which allows to specify annotations, or annotation types as constraints, depending on which binding targets may, or may not be injected.
- annotatedWith(Annotation) - Method in interface io.github.pustike.inject.bind.AnnotatedBindingBuilder
-
Specifies, that the binding can only be used for injection, if a field is annotated with an
Annotation
, that equals the given. - annotatedWith(Class<? extends Annotation>) - Method in interface io.github.pustike.inject.bind.AnnotatedBindingBuilder
-
Specifies, that the binding can only be used for injection, if a field is annotated with a qualifier
Annotation
of the given type. - asEagerSingleton() - Method in interface io.github.pustike.inject.bind.ScopedBindingBuilder
-
Instructs the
Injector
to eagerly initialize this singleton-scoped binding upon creation. - asLazySingleton() - Method in interface io.github.pustike.inject.bind.ScopedBindingBuilder
-
Instructs the
Injector
to lazily initialize (only when requested), this singleton-scoped binding.
B
- bind(BindingKey<T>) - Method in interface io.github.pustike.inject.bind.Binder
-
Binds the key which needs to be linked to a target in the
LinkedBindingBuilder
. - bind(Class<T>) - Method in interface io.github.pustike.inject.bind.Binder
-
Binds the given type which can be further annotated in the
AnnotatedBindingBuilder
. - Binder - Interface in io.github.pustike.inject.bind
-
Collects configuration information (primarily bindings) which will be used to create an Injector.
- BindingKey<T> - Class in io.github.pustike.inject
-
Binding key that contains an injection type and an optional qualifier annotation.
- BindingListener - Interface in io.github.pustike.inject.spi
-
Binding listener is invoked after binding of the type is registered into injector.
- bindProperties(Binder, Map<String, String>) - Static method in class io.github.pustike.inject.Names
-
Creates a constant binding to
@Named(key)
for each entry inkeyValueMap
. - bindProperties(Binder, Properties) - Static method in class io.github.pustike.inject.Names
-
Creates a constant binding to
@Named(key)
for each property. - bindScope(Class<? extends Annotation>, Scope) - Method in interface io.github.pustike.inject.bind.Binder
-
Binds a scope annotation to the given scope instance.
C
- close() - Method in class io.github.pustike.inject.events.EventBus
-
Clear all observers from the cache.
- configure(Binder) - Method in interface io.github.pustike.inject.bind.Module
-
Called to create bindings, by using the given
binder
during injector creation. - create(Module...) - Static method in class io.github.pustike.inject.Injectors
-
Creates a new
Injector
with bindings specified by given modules. - create(InjectionPointLoader, Iterable<Module>) - Static method in class io.github.pustike.inject.Injectors
-
Creates a new
Injector
with bindings specified by given modules and using aninjection point loader
. - create(Iterable<Module>) - Static method in class io.github.pustike.inject.Injectors
-
Creates a new
Injector
with bindings specified by given modules. - createChildInjector(Module...) - Method in interface io.github.pustike.inject.Injector
-
Returns a new injector that delegates all requests for bindings that are not found, to its parent injector.
- createChildInjector(Iterable<Module>) - Method in interface io.github.pustike.inject.Injector
-
Returns a new injector that delegates all requests for bindings that are not found, to its parent injector.
- createModule() - Static method in class io.github.pustike.inject.events.EventBus
D
- dispose(Injector) - Static method in class io.github.pustike.inject.Injectors
-
Dispose or release all data held by the Default Injector.
E
- equals(Object) - Method in class io.github.pustike.inject.BindingKey
-
Uses the computed hash code of this key to check if the given object equals.
- Event<T> - Class in io.github.pustike.inject.events
-
Typed event that provides the type of source object used.
- Event(T) - Constructor for class io.github.pustike.inject.events.Event
-
Constructs a generic Application Event.
- Event(T, Object) - Constructor for class io.github.pustike.inject.events.Event
-
Constructs a generic Application Event with the given context value.
- EventBus - Class in io.github.pustike.inject.events
-
Event Bus allows components, managed by the injector, to interact in a completely decoupled fashion, with no compile-time dependency between them.
G
- getContext() - Method in class io.github.pustike.inject.events.Event
-
Gets the event context if available, can be null.
- getIfPresent(BindingKey<T>) - Method in interface io.github.pustike.inject.Injector
-
Returns an
Optional
instance for the givenkey
, if a matching binding is present, after injecting all dependencies into its constructor, fields and methods. - getIfPresent(Class<T>) - Method in interface io.github.pustike.inject.Injector
-
Returns an
Optional
instance of the giventype
, if a matching binding is present, after injecting all dependencies into its constructor, fields and methods. - getInjectionPoints(Class<?>, Function<Class<?>, List<InjectionPoint<Object>>>) - Method in interface io.github.pustike.inject.spi.InjectionPointLoader
-
Get injection points in the given clazz.
- getInstance(BindingKey<T>) - Method in interface io.github.pustike.inject.Injector
-
Returns an instance of the binding that has been registered for the given key, after injecting all dependencies into its constructor, fields and methods.
- getInstance(Class<T>) - Method in interface io.github.pustike.inject.Injector
-
Returns an instance of
instanceType
, if a matching binding is present, after injecting all dependencies into its constructor, fields and methods. - getParent() - Method in interface io.github.pustike.inject.Injector
-
Returns this injector's parent, or
null
if this is a top-level injector. - getProvider(BindingKey<T>) - Method in interface io.github.pustike.inject.Injector
-
Returns the instance provider of the type that has been registered for the given key.
- getProvider(Class<T>) - Method in interface io.github.pustike.inject.Injector
-
Returns the instance provider of the type, if a matching binding is present.
- getSource() - Method in class io.github.pustike.inject.events.Event
-
The object on which the Event initially occurred.
- getSourceType() - Method in class io.github.pustike.inject.events.Event
-
Gets the type of event source.
- getType() - Method in class io.github.pustike.inject.BindingKey
-
Get the injection type of this key.
H
- hashCode() - Method in class io.github.pustike.inject.BindingKey
-
Computes the hash code using hash codes of the binding type and qualifier annotation or annotation type.
I
- in(Scope) - Method in interface io.github.pustike.inject.bind.ScopedBindingBuilder
-
Instances of this binding are created in the specified scope which should be already registered to the binder.
- in(Class<? extends Annotation>) - Method in interface io.github.pustike.inject.bind.ScopedBindingBuilder
-
Instances of this binding are created in the specified scope which should be already registered to the binder.
- InjectionListener - Interface in io.github.pustike.inject.spi
-
Listens for new instances created by injector, invoked after its fields and methods are injected.
- InjectionPoint<T> - Interface in io.github.pustike.inject.spi
-
Injector uses injection points to inject values into fields and methods/constructor.
- InjectionPointLoader - Interface in io.github.pustike.inject.spi
-
Strategy interface for loading injection points (to fields and methods/constructor) created by reflectively scanning through target types.
- injectMembers(Object) - Method in interface io.github.pustike.inject.Injector
-
Injects members into the given instance, as if it where created by the injector itself.
- Injector - Interface in io.github.pustike.inject
-
The injector is used to create objects with all their dependencies (fields and constructor/methods) injected.
- Injectors - Class in io.github.pustike.inject
-
This class provides factory methods to create
Injector
with bindings specified bymodules
and using anInjectionPointLoader
. - injectTo(T, Injector) - Method in interface io.github.pustike.inject.spi.InjectionPoint
-
Inject dependencies into the instance at the injection point using the given injector.
- install(Module) - Method in interface io.github.pustike.inject.bind.Binder
-
Uses the given module to configure more bindings.
- invalidateAll() - Method in interface io.github.pustike.inject.spi.InjectionPointLoader
-
Clears all cached injection points data, invoked when injector is disposed.
- io.github.pustike.inject - module io.github.pustike.inject
-
Implements JSR-330 : Jakarta Dependency Injection specification.
- io.github.pustike.inject - package io.github.pustike.inject
-
Pustike Inject is a simple dependency injection framework that implements the JSR-330 specification.
- io.github.pustike.inject.bind - package io.github.pustike.inject.bind
-
Module and Binding configuration classes used to create the
Injector
. - io.github.pustike.inject.events - package io.github.pustike.inject.events
-
EventBus allows publish-subscribe style communication between components without requiring components to explicitly register with one another (and thus be aware of each other).
- io.github.pustike.inject.spi - package io.github.pustike.inject.spi
-
Service Provider Interfaces.
- isProviderKey() - Method in class io.github.pustike.inject.BindingKey
-
Returns true if this key is of
Provider
type.
L
- LinkedBindingBuilder<T> - Interface in io.github.pustike.inject.bind
-
A binding builder, which allows to specify a bindings target: A target is the value, that gets injected, if the binding is applied.
M
- Module - Interface in io.github.pustike.inject.bind
-
A module contributes configuration information, typically interface bindings, which will be used to create an
Injector
. - multiBinder(BindingKey<T>) - Method in interface io.github.pustike.inject.bind.Binder
-
Binds the given key as
MultiBinder
to which additional bindings can be added. - multiBinder(Class<T>) - Method in interface io.github.pustike.inject.bind.Binder
-
Binds the given type as
MultiBinder
to which additional bindings can be added. - MultiBinder<T> - Interface in io.github.pustike.inject.bind
-
An API to bind multiple values separately, to later inject them as a complete collection.
N
- named(String) - Method in interface io.github.pustike.inject.bind.AnnotatedBindingBuilder
-
Specifies that the binding can only be used for injection, if a field is annotated with
Named
and has the given name. - named(String) - Static method in class io.github.pustike.inject.Names
-
Creates a
Named
annotation withname
as the value. - Names - Class in io.github.pustike.inject
-
Utility methods for use with
@
Named
. - NoSuchBindingException - Exception in io.github.pustike.inject
-
Indicates that there was a runtime failure while providing an instance.
- NoSuchBindingException(String) - Constructor for exception io.github.pustike.inject.NoSuchBindingException
-
Constructs a new exception with the specified detail message.
- NoSuchBindingException(String, Throwable) - Constructor for exception io.github.pustike.inject.NoSuchBindingException
-
Constructs a new exception with the specified detail message and cause.
- NoSuchBindingException(Throwable) - Constructor for exception io.github.pustike.inject.NoSuchBindingException
-
Constructs a new exception with the specified cause.
O
- Observes - Annotation Type in io.github.pustike.inject.events
-
Marks a method as an event observer.
- of(Class<T>) - Static method in class io.github.pustike.inject.BindingKey
-
Constructs a new Binding Key for the specified type.
- of(Class<T>, Annotation) - Static method in class io.github.pustike.inject.BindingKey
-
Constructs a new Binding Key for the specified type and the qualifier annotation.
- of(Class<T>, Class<? extends Annotation>) - Static method in class io.github.pustike.inject.BindingKey
-
Constructs a new Binding Key for the specified type and the qualifier annotation.
- of(Class<T>, String) - Static method in class io.github.pustike.inject.BindingKey
-
Constructs a new Binding Key for the specified type and name.
P
- Provides - Annotation Type in io.github.pustike.inject.bind
-
Annotates methods of a
Module
to create a method binding. - publish(Object) - Method in class io.github.pustike.inject.events.EventBus
-
Publish the event to all registered observers.
S
- scope(BindingKey<T>, Provider<T>) - Method in interface io.github.pustike.inject.Scope
-
Scopes a provider.
- Scope - Interface in io.github.pustike.inject
-
Interface to implement custom scopes.
- ScopedBindingBuilder - Interface in io.github.pustike.inject.bind
-
A binding builder, which allows to specify the scope of binding.
- setDefaultScope(Class<? extends Annotation>) - Method in interface io.github.pustike.inject.bind.Binder
-
Set the default scope to be applied when not specified for the binding.
T
- to(Class<? extends T>) - Method in interface io.github.pustike.inject.bind.LinkedBindingBuilder
-
Binds the interface to the implementation as the target which is provisioned by the injector.
- to(Constructor<? extends T>) - Method in interface io.github.pustike.inject.bind.LinkedBindingBuilder
-
Binds the interface to constructor of the implementation which is used create new instances by the injector.
- to(Method) - Method in interface io.github.pustike.inject.bind.LinkedBindingBuilder
-
Binds the interface to the factory method which is used create new instances by the injector.
- toInstance(T) - Method in interface io.github.pustike.inject.bind.LinkedBindingBuilder
-
Specifies the binding target to be the specified instance.
- toListProviderType() - Method in class io.github.pustike.inject.BindingKey
-
Create a new key to indicate that this key matches to a
List<Provider<T>>
of the given type bound usingMultiBinder
. - toListType() - Method in class io.github.pustike.inject.BindingKey
-
Create a new key to indicate that this key matches to a
List
orCollection
of the given type bound usingMultiBinder
. - toProvider(Provider<? extends T>) - Method in interface io.github.pustike.inject.bind.LinkedBindingBuilder
-
Binds the interface to a provider instance which provides instances of the target.
- toProvider(Class<? extends Provider<? extends T>>) - Method in interface io.github.pustike.inject.bind.LinkedBindingBuilder
-
Binds the interface to a provider type which is provisioned by the injector.
- toProviderType() - Method in class io.github.pustike.inject.BindingKey
-
Create a new key to indicate that this key matches to a
Provider
of the type. - toString() - Method in class io.github.pustike.inject.BindingKey
-
Generates a string representation of the key using the binding type and qualifier annotation.
- toString() - Method in interface io.github.pustike.inject.Scope
-
A short but useful description of this scope.
All Classes|All Packages