package com.google.inject.internal;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Binding;
import com.google.inject.Key;
import com.google.inject.Scope;
import com.google.inject.TypeLiteral;
import com.google.inject.spi.InjectionRequest;
import com.google.inject.spi.MembersInjectorLookup;
import com.google.inject.spi.ModuleAnnotatedMethodScannerBinding;
import com.google.inject.spi.ProviderLookup;
import com.google.inject.spi.ProvisionListenerBinding;
import com.google.inject.spi.ScopeBinding;
import com.google.inject.spi.StaticInjectionRequest;
import com.google.inject.spi.TypeConverterBinding;
import com.google.inject.spi.TypeListenerBinding;
import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
interface State {
static final State NONE =
new State() {
@Override
public State parent() {
throw new UnsupportedOperationException();
}
@Override
public <T> BindingImpl<T> getExplicitBinding(Key<T> key) {
return null;
}
@Override
public Map<Key<?>, Binding<?>> getExplicitBindingsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public void putBinding(Key<?> key, BindingImpl<?> binding) {
throw new UnsupportedOperationException();
}
@Override
public void putProviderLookup(ProviderLookup<?> lookup) {
throw new UnsupportedOperationException();
}
@Override
public Set<ProviderLookup<?>> getProviderLookupsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public void putStaticInjectionRequest(StaticInjectionRequest staticInjectionRequest) {
throw new UnsupportedOperationException();
}
@Override
public Set<StaticInjectionRequest> getStaticInjectionRequestsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public Set<InjectionRequest<?>> getInjectionRequestsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public Set<MembersInjectorLookup<?>> getMembersInjectorLookupsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public void putInjectionRequest(InjectionRequest<?> injectionRequest) {
throw new UnsupportedOperationException();
}
@Override
public void putMembersInjectorLookup(MembersInjectorLookup<?> membersInjectorLookup) {
throw new UnsupportedOperationException();
}
@Override
public ScopeBinding getScopeBinding(Class<? extends Annotation> scopingAnnotation) {
return null;
}
@Override
public void putScopeBinding(
Class<? extends Annotation> annotationType, ScopeBinding scope) {
throw new UnsupportedOperationException();
}
@Override
public void addConverter(TypeConverterBinding typeConverterBinding) {
throw new UnsupportedOperationException();
}
@Override
public TypeConverterBinding getConverter(
String stringValue, TypeLiteral<?> type, Errors errors, Object source) {
throw new UnsupportedOperationException();
}
@Override
public Iterable<TypeConverterBinding> getConvertersThisLevel() {
return ImmutableSet.of();
}
@Override
public void addMethodAspect(MethodAspect methodAspect) {
throw new UnsupportedOperationException();
}
@Override
public ImmutableList<MethodAspect> getMethodAspects() {
return ImmutableList.of();
}
@Override
public void addTypeListener(TypeListenerBinding typeListenerBinding) {
throw new UnsupportedOperationException();
}
@Override
public List<TypeListenerBinding> getTypeListenerBindings() {
return ImmutableList.of();
}
@Override
public void addProvisionListener(ProvisionListenerBinding provisionListenerBinding) {
throw new UnsupportedOperationException();
}
@Override
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
return ImmutableList.of();
}
@Override
public void addScanner(ModuleAnnotatedMethodScannerBinding scanner) {
throw new UnsupportedOperationException();
}
@Override
public List<ModuleAnnotatedMethodScannerBinding> getScannerBindings() {
return ImmutableList.of();
}
@Override
public void blacklist(Key<?> key, State state, Object source) {}
@Override
public boolean isBlacklisted(Key<?> key) {
return true;
}
@Override
public Set<Object> getSourcesForBlacklistedKey(Key<?> key) {
throw new UnsupportedOperationException();
}
@Override
public Object lock() {
throw new UnsupportedOperationException();
}
@Override
public Map<Class<? extends Annotation>, Scope> getScopes() {
return ImmutableMap.of();
}
@Override
public List<ScopeBinding> getScopeBindingsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public List<TypeListenerBinding> getTypeListenerBindingsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public List<ProvisionListenerBinding> getProvisionListenerBindingsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public List<ModuleAnnotatedMethodScannerBinding> getScannerBindingsThisLevel() {
throw new UnsupportedOperationException();
}
};
State parent();
<T> BindingImpl<T> getExplicitBinding(Key<T> key);
Map<Key<?>, Binding<?>> getExplicitBindingsThisLevel();
void putBinding(Key<?> key, BindingImpl<?> binding);
void putProviderLookup(ProviderLookup<?> lookup);
Set<ProviderLookup<?>> getProviderLookupsThisLevel();
void putStaticInjectionRequest(StaticInjectionRequest staticInjectionRequest);
Set<StaticInjectionRequest> getStaticInjectionRequestsThisLevel();
ScopeBinding getScopeBinding(Class<? extends Annotation> scopingAnnotation);
void putInjectionRequest(InjectionRequest<?> injectionRequest);
Set<InjectionRequest<?>> getInjectionRequestsThisLevel();
void putMembersInjectorLookup(MembersInjectorLookup<?> membersInjectorLookup);
Set<MembersInjectorLookup<?>> getMembersInjectorLookupsThisLevel();
void putScopeBinding(Class<? extends Annotation> annotationType, ScopeBinding scope);
Collection<ScopeBinding> getScopeBindingsThisLevel();
void addConverter(TypeConverterBinding typeConverterBinding);
TypeConverterBinding getConverter(
String stringValue, TypeLiteral<?> type, Errors errors, Object source);
Iterable<TypeConverterBinding> getConvertersThisLevel();
void addMethodAspect(MethodAspect methodAspect);
ImmutableList<MethodAspect> getMethodAspects();
void addTypeListener(TypeListenerBinding typeListenerBinding);
List<TypeListenerBinding> getTypeListenerBindings();
List<TypeListenerBinding> getTypeListenerBindingsThisLevel();
void addProvisionListener(ProvisionListenerBinding provisionListenerBinding);
List<ProvisionListenerBinding> getProvisionListenerBindings();
List<ProvisionListenerBinding> getProvisionListenerBindingsThisLevel();
void addScanner(ModuleAnnotatedMethodScannerBinding scanner);
List<ModuleAnnotatedMethodScannerBinding> getScannerBindings();
List<ModuleAnnotatedMethodScannerBinding> getScannerBindingsThisLevel();
void blacklist(Key<?> key, State state, Object source);
boolean isBlacklisted(Key<?> key);
Set<Object> getSourcesForBlacklistedKey(Key<?> key);
Object lock();
Map<Class<? extends Annotation>, Scope> getScopes();
}