Tabnine Logo
ProviderMethodsModule.getKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getKey
method
in
com.google.inject.internal.ProviderMethodsModule

Best Java code snippets using com.google.inject.internal.ProviderMethodsModule.getKey (Showing top 7 results out of 315)

origin: com.google.inject/guice

private <T> ProviderMethod<T> createProviderMethod(
  Binder binder, Method method, Annotation annotation) {
 binder = binder.withSource(method);
 Errors errors = new Errors(method);
 // prepare the parameter providers
 InjectionPoint point = InjectionPoint.forMethod(method, typeLiteral);
 @SuppressWarnings("unchecked") // Define T as the method's return type.
 TypeLiteral<T> returnType = (TypeLiteral<T>) typeLiteral.getReturnType(method);
 Key<T> key = getKey(errors, returnType, method, method.getAnnotations());
 try {
  key = scanner.prepareMethod(binder, annotation, key, point);
 } catch (Throwable t) {
  binder.addError(t);
 }
 Class<? extends Annotation> scopeAnnotation =
   Annotations.findScopeAnnotation(errors, method.getAnnotations());
 for (Message message : errors.getMessages()) {
  binder.addError(message);
 }
 return ProviderMethod.create(
   key,
   method,
   delegate,
   ImmutableSet.copyOf(point.getDependencies()),
   scopeAnnotation,
   skipFastClassGeneration,
   annotation);
}
origin: com.google/inject

Annotation[][] parameterAnnotations = method.getParameterAnnotations();
for (int i = 0; i < parameterTypes.size(); i++) {
 Key<?> key = getKey(errors, parameterTypes.get(i), method, parameterAnnotations[i]);
 if(key.equals(Key.get(Logger.class))) {
TypeLiteral<T> returnType = (TypeLiteral<T>) typeLiteral.getReturnType(method);
Key<T> key = getKey(errors, returnType, method, method.getAnnotations());
Class<? extends Annotation> scopeAnnotation
  = Annotations.findScopeAnnotation(errors, method.getAnnotations());
origin: Nextdoor/bender

Annotation[][] parameterAnnotations = method.getParameterAnnotations();
for (int i = 0; i < parameterTypes.size(); i++) {
 Key<?> key = getKey(errors, parameterTypes.get(i), method, parameterAnnotations[i]);
 if(key.equals(Key.get(Logger.class))) {
TypeLiteral<T> returnType = (TypeLiteral<T>) typeLiteral.getReturnType(method);
Key<T> key = getKey(errors, returnType, method, method.getAnnotations());
Class<? extends Annotation> scopeAnnotation
  = Annotations.findScopeAnnotation(errors, method.getAnnotations());
origin: at.bestsolution.efxclipse.eclipse/com.google.inject

Annotation[][] parameterAnnotations = method.getParameterAnnotations();
for (int i = 0; i < parameterTypes.size(); i++) {
 Key<?> key = getKey(errors, parameterTypes.get(i), method, parameterAnnotations[i]);
 if(key.equals(Key.get(Logger.class))) {
TypeLiteral<T> returnType = (TypeLiteral<T>) typeLiteral.getReturnType(method);
Key<T> key = getKey(errors, returnType, method, method.getAnnotations());
Class<? extends Annotation> scopeAnnotation
  = Annotations.findScopeAnnotation(errors, method.getAnnotations());
origin: org.xbib/guice

private <T> ProviderMethod<T> createProviderMethod(Binder binder, Method method,
                          Annotation annotation) {
  binder = binder.withSource(method);
  Errors errors = new Errors(method);
  // prepare the parameter providers
  InjectionPoint point = InjectionPoint.forMethod(method, typeLiteral);
  List<Dependency<?>> dependencies = point.getDependencies();
  List<Provider<?>> parameterProviders = Lists.newArrayList();
  for (Dependency<?> dependency : point.getDependencies()) {
    parameterProviders.add(binder.getProvider(dependency));
  }
  @SuppressWarnings("unchecked") // Define T as the method's return type.
      TypeLiteral<T> returnType = (TypeLiteral<T>) typeLiteral.getReturnType(method);
  Key<T> key = getKey(errors, returnType, method, method.getAnnotations());
  try {
    key = scanner.prepareMethod(binder, annotation, key, point);
  } catch (Throwable t) {
    binder.addError(t);
  }
  Class<? extends Annotation> scopeAnnotation
      = Annotations.findScopeAnnotation(errors, method.getAnnotations());
  for (Message message : errors.getMessages()) {
    binder.addError(message);
  }
  return ProviderMethod.create(key, method, delegate, ImmutableSet.copyOf(dependencies),
      parameterProviders, scopeAnnotation, skipFastClassGeneration, annotation);
}
origin: org.sonatype.sisu/sisu-guice

private <T> ProviderMethod<T> createProviderMethod(
  Binder binder, Method method, Annotation annotation) {
 binder = binder.withSource(method);
 Errors errors = new Errors(method);
 // prepare the parameter providers
 InjectionPoint point = InjectionPoint.forMethod(method, typeLiteral);
 @SuppressWarnings("unchecked") // Define T as the method's return type.
 TypeLiteral<T> returnType = (TypeLiteral<T>) typeLiteral.getReturnType(method);
 Key<T> key = getKey(errors, returnType, method, method.getAnnotations());
 try {
  key = scanner.prepareMethod(binder, annotation, key, point);
 } catch (Throwable t) {
  binder.addError(t);
 }
 Class<? extends Annotation> scopeAnnotation =
   Annotations.findScopeAnnotation(errors, method.getAnnotations());
 for (Message message : errors.getMessages()) {
  binder.addError(message);
 }
 return ProviderMethod.create(
   key,
   method,
   delegate,
   ImmutableSet.copyOf(point.getDependencies()),
   scopeAnnotation,
   skipFastClassGeneration,
   annotation);
}
origin: com.jwebmp.inject/guice

private <T> ProviderMethod<T> createProviderMethod(
  Binder binder, Method method, Annotation annotation) {
 binder = binder.withSource(method);
 Errors errors = new Errors(method);
 // prepare the parameter providers
 InjectionPoint point = InjectionPoint.forMethod(method, typeLiteral);
 @SuppressWarnings("unchecked") // Define T as the method's return type.
 TypeLiteral<T> returnType = (TypeLiteral<T>) typeLiteral.getReturnType(method);
 Key<T> key = getKey(errors, returnType, method, method.getAnnotations());
 try {
  key = scanner.prepareMethod(binder, annotation, key, point);
 } catch (Throwable t) {
  binder.addError(t);
 }
 Class<? extends Annotation> scopeAnnotation =
   Annotations.findScopeAnnotation(errors, method.getAnnotations());
 for (Message message : errors.getMessages()) {
  binder.addError(message);
 }
 return ProviderMethod.create(
   key,
   method,
   delegate,
   ImmutableSet.copyOf(point.getDependencies()),
   scopeAnnotation,
   skipFastClassGeneration,
   annotation);
}
com.google.inject.internalProviderMethodsModulegetKey

Popular methods of ProviderMethodsModule

  • forModule
    Returns a module which creates bindings methods in the module that match the scanner.
  • forObject
  • getProviderMethods
  • <init>
  • createProviderMethod
  • getDelegateModule
  • overrides
    Returns true if a overrides b, assumes that the signatures match
  • getAnnotation
    Returns the annotation that is claimed by the scanner, or null if there is none.
  • isProvider
    Returns true if the method is a provider. Synthetic bridge methods are excluded. Starting with JDK 8

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Reference (javax.naming)
  • JTable (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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