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.ModuleAnnotatedMethodScannerBinding;
import com.google.inject.spi.ProvisionListenerBinding;
import com.google.inject.spi.ScopeBinding;
import com.google.inject.spi.TypeConverterBinding;
import com.google.inject.spi.TypeListenerBinding;
import java.lang.annotation.Annotation;
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 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();
}
public Object singletonCreationLock() {
throw new UnsupportedOperationException();
}
@Override
public Map<Class<? extends Annotation>, Scope> getScopes() {
return ImmutableMap.of();
}
};
State parent();
<T> BindingImpl<T> getExplicitBinding(Key<T> key);
Map<Key<?>, Binding<?>> getExplicitBindingsThisLevel();
void putBinding(Key<?> key, BindingImpl<?> binding);
ScopeBinding getScopeBinding(Class<? extends Annotation> scopingAnnotation);
void putScopeBinding(Class<? extends Annotation> annotationType, ScopeBinding scope);
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();
void addProvisionListener(ProvisionListenerBinding provisionListenerBinding);
List<ProvisionListenerBinding> getProvisionListenerBindings();
void addScanner(ModuleAnnotatedMethodScannerBinding scanner);
List<ModuleAnnotatedMethodScannerBinding> getScannerBindings();
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();
}