Tabnine Logo
ConstructorResolver
Code IndexAdd Tabnine to your IDE (free)

How to use
ConstructorResolver
in
org.springframework.beans.factory.support

Best Java code snippets using org.springframework.beans.factory.support.ConstructorResolver (Showing top 20 results out of 315)

origin: spring-projects/spring-framework

/**
 * Determine whether the specified bean definition qualifies as an autowire candidate,
 * to be injected into other beans which declare a dependency of matching type.
 * @param beanName the name of the bean definition to check
 * @param mbd the merged bean definition to check
 * @param descriptor the descriptor of the dependency to resolve
 * @param resolver the AutowireCandidateResolver to use for the actual resolution algorithm
 * @return whether the bean should be considered as autowire candidate
 */
protected boolean isAutowireCandidate(String beanName, RootBeanDefinition mbd,
    DependencyDescriptor descriptor, AutowireCandidateResolver resolver) {
  String beanDefinitionName = BeanFactoryUtils.transformedBeanName(beanName);
  resolveBeanClass(mbd, beanDefinitionName);
  if (mbd.isFactoryMethodUnique && mbd.factoryMethodToIntrospect == null) {
    new ConstructorResolver(this).resolveFactoryMethodIfPossible(mbd);
  }
  return resolver.isAutowireCandidate(
      new BeanDefinitionHolder(mbd, beanName, getAliases(beanDefinitionName)), descriptor);
}
origin: spring-projects/spring-framework

/**
 * "autowire constructor" (with constructor arguments by type) behavior.
 * Also applied if explicit constructor argument values are specified,
 * matching all remaining arguments with beans from the bean factory.
 * <p>This corresponds to constructor injection: In this mode, a Spring
 * bean factory is able to host components that expect constructor-based
 * dependency resolution.
 * @param beanName the name of the bean
 * @param mbd the bean definition for the bean
 * @param ctors the chosen candidate constructors
 * @param explicitArgs argument values passed in programmatically via the getBean method,
 * or {@code null} if none (-> use constructor argument values from bean definition)
 * @return a BeanWrapper for the new instance
 */
protected BeanWrapper autowireConstructor(
    String beanName, RootBeanDefinition mbd, @Nullable Constructor<?>[] ctors, @Nullable Object[] explicitArgs) {
  return new ConstructorResolver(this).autowireConstructor(beanName, mbd, ctors, explicitArgs);
}
origin: spring-projects/spring-framework

    argsToUse = resolvePreparedArguments(beanName, mbd, bw, constructorToUse, argsToResolve, true);
        mbd.resolvedConstructorArguments = EMPTY_ARGS;
      bw.setBeanInstance(instantiate(beanName, mbd, uniqueCandidate, EMPTY_ARGS));
      return bw;
    ConstructorArgumentValues cargs = mbd.getConstructorArgumentValues();
    resolvedValues = new ConstructorArgumentValues();
    minNrOfArgs = resolveConstructorArguments(beanName, mbd, bw, cargs, resolvedValues);
        argsHolder = createArgumentArray(beanName, mbd, resolvedValues, bw, paramTypes, paramNames,
            getUserDeclaredConstructor(candidate), autowiring, candidates.length == 1);
bw.setBeanInstance(instantiate(beanName, mbd, constructorToUse, argsToUse));
return bw;
origin: spring-projects/spring-framework

/**
 * Instantiate the bean using a named factory method. The method may be static, if the
 * mbd parameter specifies a class, rather than a factoryBean, or an instance variable
 * on a factory object itself configured using Dependency Injection.
 * @param beanName the name of the bean
 * @param mbd the bean definition for the bean
 * @param explicitArgs argument values passed in programmatically via the getBean method,
 * or {@code null} if none (-> use constructor argument values from bean definition)
 * @return a BeanWrapper for the new instance
 * @see #getBean(String, Object[])
 */
protected BeanWrapper instantiateUsingFactoryMethod(
    String beanName, RootBeanDefinition mbd, @Nullable Object[] explicitArgs) {
  return new ConstructorResolver(this).instantiateUsingFactoryMethod(beanName, mbd, explicitArgs);
}
origin: spring-projects/spring-framework

    argsToUse = resolvePreparedArguments(beanName, mbd, bw, factoryMethodToUse, argsToResolve, true);
  Method[] rawCandidates = getCandidateMethods(factoryClass, mbd);
  List<Method> candidateList = new ArrayList<>();
  for (Method candidate : rawCandidates) {
        mbd.resolvedConstructorArguments = EMPTY_ARGS;
      bw.setBeanInstance(instantiate(beanName, mbd, factoryBean, uniqueCandidate, EMPTY_ARGS));
      return bw;
      ConstructorArgumentValues cargs = mbd.getConstructorArgumentValues();
      resolvedValues = new ConstructorArgumentValues();
      minNrOfArgs = resolveConstructorArguments(beanName, mbd, bw, cargs, resolvedValues);
            paramNames = pnd.getParameterNames(candidate);
          argsHolder = createArgumentArray(beanName, mbd, resolvedValues, bw,
              paramTypes, paramNames, candidate, autowiring, candidates.length == 1);
bw.setBeanInstance(instantiate(beanName, mbd, factoryBean, factoryMethodToUse, argsToUse));
return bw;
origin: camunda/camunda-bpm-platform

argsToUse = resolvePreparedArguments(beanName, mbd, bw, constructorToUse, argsToResolve);
ConstructorArgumentValues cargs = mbd.getConstructorArgumentValues();
resolvedValues = new ConstructorArgumentValues();
minNrOfArgs = resolveConstructorArguments(beanName, mbd, bw, cargs, resolvedValues);
    argsHolder = createArgumentArray(
        beanName, mbd, resolvedValues, bw, paramTypes, paramNames, candidate, autowiring);
origin: spring-projects/spring-framework

Object autowiredArgument = resolveAutowiredArgument(
    methodParam, beanName, autowiredBeanNames, converter, fallback);
args.rawArguments[paramIndex] = autowiredArgument;
origin: apache/servicemix-bundles

getUserDeclaredConstructor(candidate), autowiring);
origin: org.springframework/spring-beans

    argsToUse = resolvePreparedArguments(beanName, mbd, bw, factoryMethodToUse, argsToResolve, true);
  Method[] rawCandidates = getCandidateMethods(factoryClass, mbd);
  List<Method> candidateList = new ArrayList<>();
  for (Method candidate : rawCandidates) {
        mbd.resolvedConstructorArguments = EMPTY_ARGS;
      bw.setBeanInstance(instantiate(beanName, mbd, factoryBean, uniqueCandidate, EMPTY_ARGS));
      return bw;
      ConstructorArgumentValues cargs = mbd.getConstructorArgumentValues();
      resolvedValues = new ConstructorArgumentValues();
      minNrOfArgs = resolveConstructorArguments(beanName, mbd, bw, cargs, resolvedValues);
            paramNames = pnd.getParameterNames(candidate);
          argsHolder = createArgumentArray(beanName, mbd, resolvedValues, bw,
              paramTypes, paramNames, candidate, autowiring, candidates.length == 1);
bw.setBeanInstance(instantiate(beanName, mbd, factoryBean, factoryMethodToUse, argsToUse));
return bw;
origin: org.springframework/spring-beans

/**
 * Instantiate the bean using a named factory method. The method may be static, if the
 * mbd parameter specifies a class, rather than a factoryBean, or an instance variable
 * on a factory object itself configured using Dependency Injection.
 * @param beanName the name of the bean
 * @param mbd the bean definition for the bean
 * @param explicitArgs argument values passed in programmatically via the getBean method,
 * or {@code null} if none (-> use constructor argument values from bean definition)
 * @return a BeanWrapper for the new instance
 * @see #getBean(String, Object[])
 */
protected BeanWrapper instantiateUsingFactoryMethod(
    String beanName, RootBeanDefinition mbd, @Nullable Object[] explicitArgs) {
  return new ConstructorResolver(this).instantiateUsingFactoryMethod(beanName, mbd, explicitArgs);
}
origin: camunda/camunda-bpm-platform

argsToUse = resolvePreparedArguments(beanName, mbd, bw, factoryMethodToUse, argsToResolve);
minNrOfArgs = resolveConstructorArguments(beanName, mbd, bw, cargs, resolvedValues);
        paramNames = pnd.getParameterNames(candidate);
      argsHolder = createArgumentArray(
          beanName, mbd, resolvedValues, bw, paramTypes, paramNames, candidate, autowiring);
origin: spring-projects/spring-framework

GenericTypeResolver.resolveParameterType(methodParam, executable.getDeclaringClass());
if (argValue instanceof AutowiredArgumentMarker) {
  argValue = resolveAutowiredArgument(methodParam, beanName, null, converter, fallback);
origin: org.springframework/spring-beans

/**
 * Determine whether the specified bean definition qualifies as an autowire candidate,
 * to be injected into other beans which declare a dependency of matching type.
 * @param beanName the name of the bean definition to check
 * @param mbd the merged bean definition to check
 * @param descriptor the descriptor of the dependency to resolve
 * @param resolver the AutowireCandidateResolver to use for the actual resolution algorithm
 * @return whether the bean should be considered as autowire candidate
 */
protected boolean isAutowireCandidate(String beanName, RootBeanDefinition mbd,
    DependencyDescriptor descriptor, AutowireCandidateResolver resolver) {
  String beanDefinitionName = BeanFactoryUtils.transformedBeanName(beanName);
  resolveBeanClass(mbd, beanDefinitionName);
  if (mbd.isFactoryMethodUnique && mbd.factoryMethodToIntrospect == null) {
    new ConstructorResolver(this).resolveFactoryMethodIfPossible(mbd);
  }
  return resolver.isAutowireCandidate(
      new BeanDefinitionHolder(mbd, beanName, getAliases(beanDefinitionName)), descriptor);
}
origin: org.springframework/spring-beans

    argsToUse = resolvePreparedArguments(beanName, mbd, bw, constructorToUse, argsToResolve, true);
        mbd.resolvedConstructorArguments = EMPTY_ARGS;
      bw.setBeanInstance(instantiate(beanName, mbd, uniqueCandidate, EMPTY_ARGS));
      return bw;
    ConstructorArgumentValues cargs = mbd.getConstructorArgumentValues();
    resolvedValues = new ConstructorArgumentValues();
    minNrOfArgs = resolveConstructorArguments(beanName, mbd, bw, cargs, resolvedValues);
        argsHolder = createArgumentArray(beanName, mbd, resolvedValues, bw, paramTypes, paramNames,
            getUserDeclaredConstructor(candidate), autowiring, candidates.length == 1);
bw.setBeanInstance(instantiate(beanName, mbd, constructorToUse, argsToUse));
return bw;
origin: camunda/camunda-bpm-platform

/**
 * Instantiate the bean using a named factory method. The method may be static, if the
 * mbd parameter specifies a class, rather than a factoryBean, or an instance variable
 * on a factory object itself configured using Dependency Injection.
 * @param beanName the name of the bean
 * @param mbd the bean definition for the bean
 * @param explicitArgs argument values passed in programmatically via the getBean method,
 * or <code>null</code> if none (-> use constructor argument values from bean definition)
 * @return BeanWrapper for the new instance
 * @see #getBean(String, Object[])
 */
protected BeanWrapper instantiateUsingFactoryMethod(
    String beanName, RootBeanDefinition mbd, Object[] explicitArgs) {
  return new ConstructorResolver(this).instantiateUsingFactoryMethod(beanName, mbd, explicitArgs);
}
origin: org.springframework/spring-beans

/**
 * "autowire constructor" (with constructor arguments by type) behavior.
 * Also applied if explicit constructor argument values are specified,
 * matching all remaining arguments with beans from the bean factory.
 * <p>This corresponds to constructor injection: In this mode, a Spring
 * bean factory is able to host components that expect constructor-based
 * dependency resolution.
 * @param beanName the name of the bean
 * @param mbd the bean definition for the bean
 * @param ctors the chosen candidate constructors
 * @param explicitArgs argument values passed in programmatically via the getBean method,
 * or {@code null} if none (-> use constructor argument values from bean definition)
 * @return a BeanWrapper for the new instance
 */
protected BeanWrapper autowireConstructor(
    String beanName, RootBeanDefinition mbd, @Nullable Constructor<?>[] ctors, @Nullable Object[] explicitArgs) {
  return new ConstructorResolver(this).autowireConstructor(beanName, mbd, ctors, explicitArgs);
}
origin: org.springframework/spring-beans

Object autowiredArgument = resolveAutowiredArgument(
    methodParam, beanName, autowiredBeanNames, converter, fallback);
args.rawArguments[paramIndex] = autowiredArgument;
origin: camunda/camunda-bpm-platform

/**
 * Determine whether the specified bean definition qualifies as an autowire candidate,
 * to be injected into other beans which declare a dependency of matching type.
 * @param beanName the name of the bean definition to check
 * @param mbd the merged bean definition to check
 * @param descriptor the descriptor of the dependency to resolve
 * @return whether the bean should be considered as autowire candidate
 */
protected boolean isAutowireCandidate(String beanName, RootBeanDefinition mbd, DependencyDescriptor descriptor) {
  resolveBeanClass(mbd, beanName);
  if (mbd.isFactoryMethodUnique) {
    boolean resolve;
    synchronized (mbd.constructorArgumentLock) {
      resolve = (mbd.resolvedConstructorOrFactoryMethod == null);
    }
    if (resolve) {
      new ConstructorResolver(this).resolveFactoryMethodIfPossible(mbd);
    }
  }
  return getAutowireCandidateResolver().isAutowireCandidate(
      new BeanDefinitionHolder(mbd, beanName, getAliases(beanName)), descriptor);
}
origin: camunda/camunda-bpm-platform

/**
 * "autowire constructor" (with constructor arguments by type) behavior.
 * Also applied if explicit constructor argument values are specified,
 * matching all remaining arguments with beans from the bean factory.
 * <p>This corresponds to constructor injection: In this mode, a Spring
 * bean factory is able to host components that expect constructor-based
 * dependency resolution.
 * @param beanName the name of the bean
 * @param mbd the bean definition for the bean
 * @param ctors the chosen candidate constructors
 * @param explicitArgs argument values passed in programmatically via the getBean method,
 * or <code>null</code> if none (-> use constructor argument values from bean definition)
 * @return BeanWrapper for the new instance
 */
protected BeanWrapper autowireConstructor(
    String beanName, RootBeanDefinition mbd, Constructor[] ctors, Object[] explicitArgs) {
  return new ConstructorResolver(this).autowireConstructor(beanName, mbd, ctors, explicitArgs);
}
origin: org.springframework/spring-beans

GenericTypeResolver.resolveParameterType(methodParam, executable.getDeclaringClass());
if (argValue instanceof AutowiredArgumentMarker) {
  argValue = resolveAutowiredArgument(methodParam, beanName, null, converter, fallback);
org.springframework.beans.factory.supportConstructorResolver

Javadoc

Delegate for resolving constructors and factory methods. Performs constructor resolution through argument matching.

Most used methods

  • <init>
    Create a new ConstructorResolver for the given factory and instantiation strategy.
  • resolveFactoryMethodIfPossible
    Resolve the factory method in the specified bean definition, if possible. RootBeanDefinition#getReso
  • autowireConstructor
    "autowire constructor" (with constructor arguments by type) behavior. Also applied if explicit const
  • createArgumentArray
    Create an array of arguments to invoke a constructor or factory method, given the resolved construct
  • getUserDeclaredConstructor
  • instantiateUsingFactoryMethod
    Instantiate the bean using a named factory method. The method may be static, if the bean definition
  • resolveAutowiredArgument
    Template method for resolving the specified argument which is supposed to be autowired.
  • resolveConstructorArguments
    Resolve the constructor arguments for this bean into the resolvedValues object. This may involve loo
  • resolvePreparedArguments
    Resolve the prepared arguments stored in the given bean definition.
  • getCandidateMethods
    Retrieve all candidate methods for the given class, considering the RootBeanDefinition#isNonPublicAc
  • instantiate
  • setCurrentInjectionPoint
  • instantiate,
  • setCurrentInjectionPoint

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top plugins for Android Studio
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