Create a provider for an injection point.
540674
private <T> Provider<T> lookupProvider(InjectionPoint<T> ip)
  {
    Key<T> key = ip.key();

    BindingInject<T> bean = findBean(key);

    if (bean != null) {
      return bean.provider(ip);
    }

    BindingAmp<T> provider = findBinding(key);

    if (provider != null) {
      return provider.provider(ip);
    }

    provider = findObjectBinding(key);

    if (provider != null) {
      return provider.provider(ip);
    }


    return null;
  }
681738
function Injector(obj){
  var services = {};
  var get = name => {
    if(!(name in services)){
      const err = new Error(`[injector] service "${name}" not found`);
      return Promise.reject(err);
    }
    return services[name];
  };
  if(typeof obj === 'object')
    services = obj;
  if(typeof obj === 'function')
    get = obj;
  function resolve(name) {
    let service = get(name);
    if(typeof service === 'function')
      service = invoke(service);
    return service;
  };
  function invoke(fn, that){
    return Promise
    .all(getParameterNames(fn).map(resolve))
    .then(params => fn.apply(that, params));
  }
  return invoke;
}
1116716
def create(cls, service=None, endpoint=None, data=None, *args, **kwargs):
        
        cls.validate(data)

        if service is None and endpoint is None:
            raise InvalidArguments(service, endpoint)
        if endpoint is None:
            sid = service['id'] if isinstance(service, Entity) else service
            endpoint = 'services/{0}/integrations'.format(sid)

        # otherwise endpoint should contain the service path too
        return getattr(Entity, 'create').__func__(cls, endpoint=endpoint,
                                                  data=data, *args, **kwargs)
249059
public static <T> Provider<T> guicify(javax.inject.Provider<T> provider) {
    if (provider instanceof Provider) {
      return (Provider<T>) provider;
    }

    final javax.inject.Provider<T> delegate = checkNotNull(provider, "provider");

    // Ensure that we inject all injection points from the delegate provider.
    Set<InjectionPoint> injectionPoints =
        InjectionPoint.forInstanceMethodsAndFields(provider.getClass());
    if (injectionPoints.isEmpty()) {
      return new GuicifiedProvider<T>(delegate);
    } else {
      Set<Dependency<?>> mutableDeps = Sets.newHashSet();
      for (InjectionPoint ip : injectionPoints) {
        mutableDeps.addAll(ip.getDependencies());
      }
      final Set<Dependency<?>> dependencies = ImmutableSet.copyOf(mutableDeps);
      return new GuicifiedProviderWithDependencies<T>(dependencies, delegate);
    }
  }
1060898
function createPlatformFactory(parentPlatformFactory, name, providers) {
    if (providers === void 0) { providers = []; }
    var /** @type {?} */ marker = new InjectionToken("Platform: " + name);
    return function (extraProviders) {
        if (extraProviders === void 0) { extraProviders = []; }
        var /** @type {?} */ platform = getPlatform();
        if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
            if (parentPlatformFactory) {
                parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
            }
            else {
                createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));
            }
        }
        return assertPlatform(marker);
    };
}
574857
@Override
    public InjectionBinding<ConnectionFactoryDefinition> createInjectionBinding(ConnectionFactoryDefinition annotation, Class<?> instanceClass, Member member, String jndiName) throws InjectionException {
        InjectionBinding<ConnectionFactoryDefinition> injectionBinding =
                        new ConnectionFactoryDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
        injectionBinding.merge(annotation, instanceClass, null);
        return injectionBinding;
    }
1186820
public static Marker createProvided(Provided provided) {
        requireNonNull(provided);
        return new Marker(Marker.class.getResource("/markers/" + provided.getFilename()), provided.getOffsetX(),
                provided.getOffsetY());
    }
1352467
public static InjectionProvider<?>[] providersForInstancesSuppliers(final InjectionProviderInstancesSupplier... suppliers) {
        final InjectionProviderInstancesSupplier supplier = mergeSuppliers(suppliers);
        return supplier.get().toArray(new InjectionProvider<?>[supplier.get().size()]);
    }
622784
@Inject
  @Provides
  @Singleton
  public ResponseHandler provideResponseHandler(PageResponseWriter pageResponseWriter,
      ApiResponseWriter apiResponseWriter, BinaryResponseWriter binaryResponseWriter,
      RedirectResponseWriter redirectResponseWriter, ExceptionStatusMapper exceptionStatusMapper) {
    return new DefaultResponseHandler(pageResponseWriter, apiResponseWriter, binaryResponseWriter,
      redirectResponseWriter, exceptionStatusMapper);
  }
577925
private <T> Provider<T> createProvider(Key<T> key)
  {
    Class<T> type = (Class<T>) key.rawClass();

    if (Provider.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Provider.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderProvider(key, -10, provider(subkey));
    }
    else if (Optional.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Optional.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderOptional(key, -10, provider(subkey));
    }
    else if (type.isInterface() || Modifier.isAbstract(type.getModifiers())) {
      return new ProviderNull(key, -10000, new InjectScopeSingleton());
    }

    int priority = -10;

    // auto-provider is factory
    InjectScope<T> scope = findScope(type);

    BindingAmp<T> binding = new ProviderConstructor<>(this, key, priority, scope, type);

    binding.bind();

    return binding.provider();
  }
674216
@Produces
	@Logging
	public Logger createLogger(InjectionPoint injectionPoint) {
		// the annotation should not be null as it is a qualifier for this producer
		Logging annotation = injectionPoint.getAnnotated().getAnnotation(Logging.class);
		
		// get the logger name
		String name = annotation.name();
		
		// if the name is empty resolve to the class name 
		// that contains the injection point
		if(name == null || name.isEmpty()) {
			return this.createClassLogger(injectionPoint);
		}
		
		// get resolver
		Resolver resolverAnnotation = annotation.resolver();
		ResolverWrapper wrapper = new ResolverAnnotationWrapper(resolverAnnotation);
		PropertyResolver resolver = this.resolverFactory.createPropertyResolver(wrapper);
		Map<Object,Object> bootstrapMap = this.resolverFactory.getBootstrapProperties(wrapper);
		Map<Object,Object> defaultMap = this.resolverFactory.getDefaultProperties(wrapper);
		
		// resolve name
		String resolvedName = resolver.resolveProperties(name, bootstrapMap, defaultMap);
				
		// otherwise use the name to create the logger
		return Logger.getLogger(resolvedName);
	}
1337994
@Override
    public final InjectionBinding<A> createInjectionBinding(A annotation,
                                                            Class<?> instanceClass,
                                                            Member member,
                                                            String jndiName)
                    throws InjectionException
    {
        return createInjectionBinding(annotation, instanceClass, member);
    }
1125647
protected function createEach() {
        foreach ($this->providers as $class => &$data) {
            if ( ! array_get($data, 'instance')) {
                $instance = $this->getProviderInvoker()
                    ->create($class, $this->getSharedArguments());
                array_set($data, 'instance', $instance);

                $this->create();
                break;
            }
        }
    }
723084
function createPlatformFactory(parentPlaformFactory, name, providers) {
	        if (providers === void 0) { providers = []; }
	        var marker = new OpaqueToken("Platform: " + name);
	        return function (extraProviders) {
	            if (extraProviders === void 0) { extraProviders = []; }
	            if (!getPlatform()) {
	                if (parentPlaformFactory) {
	                    parentPlaformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
	                }
	                else {
	                    createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));
	                }
	            }
	            return assertPlatform(marker);
	        };
	    }
212123
function createOrAppendInjectionPoint(contract, key, value) {
  if (contract.injectionPoints[key]) {
    contract.injectionPoints[key].push(value);
  } else {
    contract.injectionPoints[key] = [value];
  }
}
858762
static WebServiceRef createWebServiceRefFromResource(Resource resource, Class<?> typeClass, String jndiName) throws InjectionException {
        // notice we send in 'Service.class' for the 'value' attribute, this is
        // because only service type injections are possible with the @Resource
        // annotation, so we'll use the default value for the 'value' attribute.
        return new WebServiceRefSimulator(resource.mappedName(), jndiName, typeClass, Service.class, null, "");
    }
63892
private <T> Provider<T> autoProvider(Key<T> key)
  {
    for (InjectAutoBind autoBind : _autoBind) {
      Provider<T> provider = autoBind.provider(this, key);

      if (provider != null) {
        return provider;
      }
    }

    return providerDefault(key);
  }