Scoping
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.google.inject.internal.Scoping(Showing top 15 results out of 315)

  • Common ways to obtain Scoping
private void myMethod () {
Scoping s =
  • BindingImpl bindingImpl;bindingImpl.getScoping()
  • ScopedBindingBuilder scopedBindingBuilder;scopedBindingBuilder.in(scopeAnnotation)
  • ScopedBindingBuilder scopedBindingBuilder;scopedBindingBuilder.in(scope)
  • Smart code suggestions by Codota
}
origin: com.google.inject/guice

/**
 * Returns true if this is the default scope. In this case a new instance will be provided for
 * each injection.
 */
public boolean isNoScope() {
 return getScopeInstance() == Scopes.NO_SCOPE;
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof InstanceBindingImpl) {
  InstanceBindingImpl<?> o = (InstanceBindingImpl<?>) obj;
  return getKey().equals(o.getKey())
    && getScoping().equals(o.getScoping())
    && Objects.equal(instance, o.instance);
 } else {
  return false;
 }
}
origin: com.google.inject/guice

@Override
public void applyTo(Binder binder) {
 getScoping()
   .applyTo(binder.withSource(getSource()).bind(getKey()).toProvider(getProviderKey()));
}
origin: com.google.inject/guice

public void in(final Scope scope) {
 checkNotNull(scope, "scope");
 checkNotScoped();
 setBinding(getBinding().withScoping(Scoping.forInstance(scope)));
}
origin: com.google.inject/guice

 protected void checkNotScoped() {
  // Scoping isn't allowed when we have only one instance.
  if (binding instanceof InstanceBinding) {
   binder.addError(SINGLE_INSTANCE_AND_SCOPE);
   return;
  }

  if (binding.getScoping().isExplicitlyScoped()) {
   binder.addError(SCOPE_ALREADY_SET);
  }
 }
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof UntargettedBindingImpl) {
  UntargettedBindingImpl<?> o = (UntargettedBindingImpl<?>) obj;
  return getKey().equals(o.getKey()) && getScoping().equals(o.getScoping());
 } else {
  return false;
 }
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof Scoping) {
  Scoping o = (Scoping) obj;
  return Objects.equal(getScopeAnnotation(), o.getScopeAnnotation())
    && Objects.equal(getScopeInstance(), o.getScopeInstance());
 } else {
  return false;
 }
}
origin: com.google.inject/guice

@Override
public void applyTo(Binder binder) {
 getScoping()
   .applyTo(
     binder.withSource(getSource()).bind(getKey()).toProvider(getUserSuppliedProvider()));
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof ProviderInstanceBindingImpl) {
  ProviderInstanceBindingImpl<?> o = (ProviderInstanceBindingImpl<?>) obj;
  return getKey().equals(o.getKey())
    && getScoping().equals(o.getScoping())
    && Objects.equal(providerInstance, o.providerInstance);
 } else {
  return false;
 }
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof ProviderBindingImpl) {
  ProviderBindingImpl<?> o = (ProviderBindingImpl<?>) obj;
  return getKey().equals(o.getKey())
    && getScoping().equals(o.getScoping())
    && Objects.equal(providedBinding, o.providedBinding);
 } else {
  return false;
 }
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof ConstructorBindingImpl) {
  ConstructorBindingImpl<?> o = (ConstructorBindingImpl<?>) obj;
  return getKey().equals(o.getKey())
    && getScoping().equals(o.getScoping())
    && Objects.equal(constructorInjectionPoint, o.constructorInjectionPoint);
 } else {
  return false;
 }
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof LinkedProviderBindingImpl) {
  LinkedProviderBindingImpl<?> o = (LinkedProviderBindingImpl<?>) obj;
  return getKey().equals(o.getKey())
    && getScoping().equals(o.getScoping())
    && Objects.equal(providerKey, o.providerKey);
 } else {
  return false;
 }
}
origin: com.google.inject/guice

public void in(final Class<? extends Annotation> scopeAnnotation) {
 checkNotNull(scopeAnnotation, "scopeAnnotation");
 checkNotScoped();
 setBinding(getBinding().withScoping(Scoping.forAnnotation(scopeAnnotation)));
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof LinkedBindingImpl) {
  LinkedBindingImpl<?> o = (LinkedBindingImpl<?>) obj;
  return getKey().equals(o.getKey())
    && getScoping().equals(o.getScoping())
    && Objects.equal(targetKey, o.targetKey);
 } else {
  return false;
 }
}
origin: com.google.inject/guice

@Override
public boolean equals(Object obj) {
 if (obj instanceof ConvertedConstantBindingImpl) {
  ConvertedConstantBindingImpl<?> o = (ConvertedConstantBindingImpl<?>) obj;
  return getKey().equals(o.getKey())
    && getScoping().equals(o.getScoping())
    && Objects.equal(value, o.value);
 } else {
  return false;
 }
}
com.google.inject.internalScoping

Javadoc

References a scope, either directly (as a scope instance), or indirectly (as a scope annotation). The scope's eager or laziness is also exposed.

Most used methods

  • getScopeAnnotation
    Returns the scope annotation, or null if that isn't known for this instance.
  • getScopeInstance
    Returns the scope instance, or null if that isn't known for this instance.
  • applyTo
  • forAnnotation
  • forInstance
  • isNoScope
    Returns true if this is the default scope. In this case a new instance will be provided for each inj
  • <init>
  • acceptVisitor
  • equals
  • isEagerSingleton
    Returns true if this scope is a singleton that should be loaded eagerly in stage.
  • isExplicitlyScoped
    Returns true if this scope was explicitly applied. If no scope was explicitly applied then the scopi
  • makeInjectable
    Replaces annotation scopes with instance scopes using the Injector's annotation-to-instance map. If
  • isExplicitlyScoped,
  • makeInjectable,
  • scope

Popular classes and methods

  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
  • Menu (java.awt)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ResultSet (java.sql)
    A table of data representing a database result set, which is usually generated by executing a statem
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)