Package org.eclipse.sisu.inject
Class InjectorBindings
java.lang.Object
org.eclipse.sisu.inject.InjectorBindings
- All Implemented Interfaces:
BindingPublisher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RankingFunctionprivate final com.google.inject.Injectorprivate static final com.google.inject.Binding<?>[]private static final com.google.inject.TypeLiteral<Object>private com.google.inject.Binding<?>[] -
Constructor Summary
ConstructorsConstructorDescriptionInjectorBindings(com.google.inject.Injector injector) InjectorBindings(com.google.inject.Injector injector, RankingFunction function) -
Method Summary
Modifier and TypeMethodDescriptionbooleancom.google.inject.Injectorprivate com.google.inject.Binding<?>[]inthashCode()private static <T,S> boolean isAssignableFrom(com.google.inject.TypeLiteral<T> type, com.google.inject.Binding<S> binding) intEstimates the maximum rank this publisher may assign to aBinding.private <T> voidpublishExactMatches(com.google.inject.TypeLiteral<T> type, BindingSubscriber<T> subscriber) private <T,S> void publishGenericMatches(com.google.inject.TypeLiteral<T> type, BindingSubscriber<T> subscriber, Class<S> rawType) private <T> voidpublishWildcardMatches(com.google.inject.TypeLiteral<T> type, BindingSubscriber<T> subscriber) <T> voidsubscribe(BindingSubscriber<T> subscriber) Subscribes the givenBindingSubscriberto receiveBindings.toString()<T> voidunsubscribe(BindingSubscriber<T> subscriber) Stops the givenBindingSubscriberfrom receivingBindings.
-
Field Details
-
OBJECT_TYPE_LITERAL
-
NO_BINDINGS
private static final com.google.inject.Binding<?>[] NO_BINDINGS -
injector
private final com.google.inject.Injector injector -
function
-
wildcards
private volatile com.google.inject.Binding<?>[] wildcards
-
-
Constructor Details
-
InjectorBindings
-
InjectorBindings
public InjectorBindings(com.google.inject.Injector injector)
-
-
Method Details
-
getInjector
public com.google.inject.Injector getInjector() -
subscribe
Description copied from interface:BindingPublisherSubscribes the givenBindingSubscriberto receiveBindings.- Specified by:
subscribein interfaceBindingPublisher- Parameters:
subscriber- The subscriber
-
unsubscribe
Description copied from interface:BindingPublisherStops the givenBindingSubscriberfrom receivingBindings.- Specified by:
unsubscribein interfaceBindingPublisher- Parameters:
subscriber- The subscriber
-
maxBindingRank
public int maxBindingRank()Description copied from interface:BindingPublisherEstimates the maximum rank this publisher may assign to aBinding.- Specified by:
maxBindingRankin interfaceBindingPublisher- Returns:
- Maximum binding rank
-
hashCode
public int hashCode() -
equals
-
toString
-
isAssignableFrom
private static <T,S> boolean isAssignableFrom(com.google.inject.TypeLiteral<T> type, com.google.inject.Binding<S> binding) -
publishExactMatches
private <T> void publishExactMatches(com.google.inject.TypeLiteral<T> type, BindingSubscriber<T> subscriber) -
publishGenericMatches
private <T,S> void publishGenericMatches(com.google.inject.TypeLiteral<T> type, BindingSubscriber<T> subscriber, Class<S> rawType) -
publishWildcardMatches
private <T> void publishWildcardMatches(com.google.inject.TypeLiteral<T> type, BindingSubscriber<T> subscriber) -
getWildcardBindings
private com.google.inject.Binding<?>[] getWildcardBindings()
-