Binds a {@link DynamicBindingProvider} for the given {@link TypeLiteral} and this module's
binding annotation.
342028
protected <T> void bindDynamicProvider(TypeLiteral<T> typeLiteral) {
    DynamicAnnotations.bindDynamicProvider(binder(), Key.get(typeLiteral, getBindingAnnotation()));
  }
981213
@SuppressWarnings("unchecked")
    private ConverterProvider findProvider(Class<?> valueType) {
        if (valueType == null) {
            return null;
        }

        if (unsupportedTypes.contains(valueType)) {
            return null;
        }

        ConverterProvider provider = providers.get(valueType);
        if (provider != null) {
            return provider;
        }

        List<Class<?>> supertypes = getSupertypes(valueType);
        for (Class<?> supertype : supertypes) {
            provider = findProvider(supertype);
            if (provider != null) {
                LOGGER.debug("Adding shortcut mapping {} -> {}", valueType.getCanonicalName(), provider.converterType().getCanonicalName());
                providers.put(valueType, provider);
                return provider;
            }
        }
        unsupportedTypes.add(valueType);
        return null;
    }
646502
private void addTypes(Injector injector, List<Class<?>> types) {
        for (Binding<?> binding : injector.getBindings().values()) {
            Key<?> key = binding.getKey();
            Type type = key.getTypeLiteral().getType();
            if (hasAnnotatedMethods(type)) {
                types.add(((Class<?>)type));
            }
        }
        if (injector.getParent() != null) {
            addTypes(injector.getParent(), types);
        }
    }
265294
protected Binding bindAnnotatedWith(TypeReference bind, TypeReference annotatedWith, TypeReference to,
			String functionName) {
		final StringConcatenationClient client = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation builder) {
				builder.append("binder.bind("); //$NON-NLS-1$
				builder.append(bind);
				builder.append(".class).annotatedWith("); //$NON-NLS-1$
				builder.append(annotatedWith);
				builder.append(".class).to("); //$NON-NLS-1$
				builder.append(to);
				builder.append(".class);"); //$NON-NLS-1$
			}
		};
		String fctname = functionName;
		if (Strings.isEmpty(fctname)) {
			fctname = bind.getSimpleName();
		}
		final BindKey key = new GuiceModuleAccess.BindKey(formatFunctionName(fctname), null, false, false);
		final  BindValue statements = new BindValue(null, null, false, Collections.singletonList(client));
	    return new Binding(key, statements, true, this.name);
	}
991042
function customTypeAnnotation(path) {
    if (path.typeAnnotation) {
      return path.typeAnnotation;
    }

    // We are not handling the case of literals and other base types
    // since they are already handled via getTypeAnnotation
    const { node } = path;
    const binding = path.parentPath.scope.getBinding(node.name);

    const types = [];
    if (binding && binding.constantViolations) {
      if (binding.identifier.typeAnnotation) {
        return binding.identifier.typeAnnotation;
      }
      if (binding.constantViolations) {
        const violations = binding.constantViolations;
        for (let violation of violations) {
          types.push(violation.getTypeAnnotation());
        }
      }
    }

    if (types.length > 0) {
      return t.createUnionTypeAnnotation(types);
    }
    return types;
  }
1052218
static BindTransform getLanguageTransform(TypeName type) {
		String typeName = type.toString();

		if (Integer.class.getCanonicalName().equals(typeName)) {
			return new IntegerBindTransform(true);
		}
		if (Boolean.class.getCanonicalName().equals(typeName)) {
			return new BooleanBindTransform(true);
		}
		if (Long.class.getCanonicalName().equals(typeName)) {
			return new LongBindTransform(true);
		}
		if (Double.class.getCanonicalName().equals(typeName)) {
			return new DoubleBindTransform(true);
		}
		if (Float.class.getCanonicalName().equals(typeName)) {
			return new FloatBindTransform(true);
		}
		if (Short.class.getCanonicalName().equals(typeName)) {
			return new ShortBindTransform(true);
		}
		if (Byte.class.getCanonicalName().equals(typeName)) {
			return new ByteBindTransform(true);
		}
		if (Character.class.getCanonicalName().equals(typeName)) {
			return new CharacterBindTransform(true);
		}
		if (String.class.getCanonicalName().equals(typeName)) {
			return new StringBindTransform();
		}
		return null;
	}
51442
protected BindingTemplate loadBindingTemplate(String type) {
        try (final InputStream is = AddMojo.class.getResourceAsStream("/bindings.json")) {
            final String bindingsJsonStr = IOUtil.toString(is);
            final BindingsTemplate bindingsTemplate = new ObjectMapper()
                .readValue(bindingsJsonStr, BindingsTemplate.class);
            return bindingsTemplate.getBindingTemplateByName(type);
        } catch (IOException e) {
            warning(LOAD_BINDING_TEMPLATES_FAIL);
            // Add mojo could work without Binding Template, just return null if binding load fail
            return null;
        }
    }
1368712
public <T> GinFactoryModuleBuilder implement(Key<T> source, TypeLiteral<? extends T> target) {
    bindings.addBinding(source, target);
    return this;
  }
387680
@SuppressWarnings("unchecked")
  public static <T> TypeLiteral<T> get(Class<T> type, Type... parameters) {
    return (TypeLiteral<T>) TypeLiteral.get(new ParameterizedTypeImpl(type, parameters));
  }
829740
public void addScopeBindings(Map<Class<? extends Annotation>, Scope> bindings) {
        if (scopeCleaner.isRunning()) {
            scopeBindings.putAll(bindings);
        }
    }
1197741
static CodeBlock bindingTypeDocs(
      TypeName type, boolean abstrakt, boolean members, boolean dependent) {
    CodeBlock.Builder result = CodeBlock.builder()
        .add("A {@code Binding<$T>} implementation which satisfies\n", type)
        .add("Dagger's infrastructure requirements including:\n");
    if (dependent) {
      result.add("\n")
          .add("Owning the dependency links between {@code $T} and its\n", type)
          .add("dependencies.\n");
    }
    if (!abstrakt) {
      result.add("\n")
          .add("Being a {@code Provider<$T>} and handling creation and\n", type)
          .add("preparation of object instances.\n");
    }
    if (members) {
      result.add("\n")
          .add("Being a {@code MembersInjector<$T>} and handling injection\n", type)
          .add("of annotated fields.\n");
    }
    return result.build();
  }
452081
private void addBinding(Binding<?, ?, V> binding)
	{
		bindings.add(binding);
		
		// prevent infinite loop when binder bound by itself
		if (binding.getSource() != this)
		{
			updateViolations();
			
			// TODO: aggregate violations better; ideally provide a live view
			binding.addObservableListener(new ObservableListener<Collection<V>>()
			{
				public void valueChanged(ObservableEvent<Collection<V>> event)
				{
					updateViolations();
				}
			});
		}
	}
406848
def bind(self, typevar, its_type):
        
        assert type(typevar) == tg.TypeVar
        if self.is_generic_in(typevar):
            self.bind_to_instance(typevar, its_type)
        else:
            self._ns[typevar] = its_type
585428
public <A> BindStep<ConfigFactory, A> bind(final Class<A> type) {

        checkNotNull(type);

        return new BindStep<ConfigFactory, A>() {

            @Override
            public ConfigFactory toInstance(A instance) {

                return withBindings(
                    bindings.set(type, checkNotNull(instance))
                );
            }

            @Override
            public ConfigFactory toNothing() {

                return withBindings(
                    bindings.remove(type)
                );
            }
        };
    }
579237
protected final <T> GinAnnotatedBindingBuilder<T> bind(Class<T> clazz) {
    return binder.bind(clazz);
  }
428077
public ProviderInfo setDynamicAttr(String dynamicAttrKey, Object dynamicAttrValue) {
        if (dynamicAttrValue == null) {
            dynamicAttrs.remove(dynamicAttrKey);
        } else {
            dynamicAttrs.put(dynamicAttrKey, dynamicAttrValue);
        }
        return this;
    }
135537
static BindTransform getPrimitiveTransform(TypeName type) {

		if (Integer.TYPE.toString().equals(type.toString())) {
			return new IntegerBindTransform(false);
		}
		if (Boolean.TYPE.toString().equals(type.toString())) {
			return new BooleanBindTransform(false);
		}
		if (Long.TYPE.toString().equals(type.toString())) {
			return new LongBindTransform(false);
		}
		if (Double.TYPE.toString().equals(type.toString())) {
			return new DoubleBindTransform(false);
		}
		if (Float.TYPE.toString().equals(type.toString())) {
			return new FloatBindTransform(false);
		}
		if (Short.TYPE.toString().equals(type.toString())) {
			return new ShortBindTransform(false);
		}
		if (Byte.TYPE.toString().equals(type.toString())) {
			return new ByteBindTransform(false);
		}
		if (Character.TYPE.toString().equals(type.toString())) {
			return new CharacterBindTransform(false);
		}
		return null;
	}