com.google.inject.internal.State Maven / Gradle / Ivy
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;
/**
* The inheritable data within an injector. This class is intended to allow parent and local
* injector data to be accessed as a unit.
*
*/
interface State {
State NONE = new State() {
@Override
public State parent() {
throw new UnsupportedOperationException();
}
@Override
public BindingImpl getExplicitBinding(Key key) {
return null;
}
@Override
public Map, 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> getProviderLookupsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public void putStaticInjectionRequest(StaticInjectionRequest staticInjectionRequest) {
throw new UnsupportedOperationException();
}
@Override
public Set getStaticInjectionRequestsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public Set> getInjectionRequestsThisLevel() {
throw new UnsupportedOperationException();
}
@Override
public Set> 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 getConvertersThisLevel() {
return ImmutableSet.of();
}
@Override
public void addTypeListener(TypeListenerBinding typeListenerBinding) {
throw new UnsupportedOperationException();
}
@Override
public List getTypeListenerBindings() {
return ImmutableList.of();
}
@Override
public void addProvisionListener(ProvisionListenerBinding provisionListenerBinding) {
throw new UnsupportedOperationException();
}
@Override
public List getProvisionListenerBindings() {
return ImmutableList.of();
}
@Override
public void addScanner(ModuleAnnotatedMethodScannerBinding scanner) {
throw new UnsupportedOperationException();
}
@Override
public List 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