Tabnine Logo
ScopeImpl.toProvider
Code IndexAdd Tabnine to your IDE (free)

How to use
toProvider
method
in
toothpick.ScopeImpl

Best Java code snippets using toothpick.ScopeImpl.toProvider (Showing top 4 results out of 315)

origin: stephanenicolas/toothpick

@Test(expected = IllegalStateException.class)
public void testToBinding_shouldFail_whenAddingANullBinding() {
 //GIVEN
 //WHEN
 new ScopeImpl("").toProvider(null);
 //THEN
}
origin: stephanenicolas/toothpick

private void installModule(boolean isTestModule, Module module) {
 for (Binding binding : module.getBindingSet()) {
  if (binding == null) {
   throw new IllegalStateException("A module can't have a null binding : " + module);
  }
  Class clazz = binding.getKey();
  String bindingName = binding.getName();
  try {
   if (isTestModule || getBoundProvider(clazz, bindingName) == null) {
    InternalProviderImpl provider = toProvider(binding);
    if (binding.isCreatingInstancesInScope()) {
     installScopedProvider(clazz, bindingName, (ScopedProviderImpl) provider, isTestModule);
    } else {
     installBoundProvider(clazz, bindingName, provider, isTestModule);
    }
   }
  } catch (Exception e) {
   throw new IllegalBindingException(format("Binding %s couldn't be installed", bindingName), e);
  }
 }
}
origin: com.github.stephanenicolas.toothpick/toothpick-runtime

private void installModule(boolean isTestModule, Module module) {
 for (Binding binding : module.getBindingSet()) {
  if (binding == null) {
   throw new IllegalStateException("A module can't have a null binding : " + module);
  }
  Class clazz = binding.getKey();
  String bindingName = binding.getName();
  try {
   if (isTestModule || getBoundProvider(clazz, bindingName) == null) {
    InternalProviderImpl provider = toProvider(binding);
    if (binding.isCreatingInstancesInScope()) {
     installScopedProvider(clazz, bindingName, (ScopedProviderImpl) provider, isTestModule);
    } else {
     installBoundProvider(clazz, bindingName, provider, isTestModule);
    }
   }
  } catch (Exception e) {
   throw new IllegalBindingException(format("Binding %s couldn't be installed", bindingName), e);
  }
 }
}
origin: com.github.stephanenicolas/toothpick-runtime

private void installModule(Module module) {
 for (Binding binding : module.getBindingSet()) {
  if (binding == null) {
   throw new IllegalStateException("A module can't have a null binding : " + module);
  }
  Class clazz = binding.getKey();
  String bindingName = binding.getName();
  if (!hasTestModules || getBoundProvider(clazz, bindingName) == null) {
   InternalProviderImpl provider = toProvider(binding);
   if (binding.isScoped()) {
    installScopedProvider(clazz, bindingName, (ScopedProviderImpl) provider);
   } else {
    installBoundProvider(clazz, bindingName, provider);
   }
  }
 }
}
toothpickScopeImpltoProvider

Popular methods of ScopeImpl

  • <init>
  • installModules
  • lookupProvider
    The core of Toothpick internals : the provider lookup. It will look for a scoped provider, bubbling
  • createInternalProvider
  • getBoundProvider
    Obtains the provider of the class clazz and name bindingName, if any. The returned provider will be
  • getInstance
  • getInternalProvider
    Obtains the provider of the class clazz and name bindingName. The returned provider can either be bo
  • getLazy
  • getName
  • getProvider
  • getRootScope
  • getUnBoundProvider
    Obtains the provider of the class clazz and name bindingName, if any. The returned provider will bel
  • getRootScope,
  • getUnBoundProvider,
  • installBoundProvider,
  • installInternalProvider,
  • installModule,
  • installNamedProvider,
  • installScopedProvider,
  • installUnBoundProvider,
  • installUnNamedProvider

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JLabel (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now