spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
/**
	 * Resolve the factory method in the specified bean definition, if possible.
	 * {@link RootBeanDefinition#getResolvedFactoryMethod()} can be checked for the result.
	 *
	 * @param mbd the bean definition to check
	 */
Resolve the factory method in the specified bean definition, if possible.
RootBeanDefinition#getResolvedFactoryMethod() can be checked for the result.

@param mbd the bean definition to check
Resolve the factory method in the specified bean definition if possible . RootBeanDefinition#getResolvedFactoryMethod () can be checked for the result . @param mbd the bean definition to check
public void resolveFactoryMethodIfPossible(RootBeanDefinition mbd) {
		Class<?> factoryClass;
		boolean isStatic;
		if (mbd.getFactoryBeanName() != null) {
			factoryClass = this.beanFactory.getType(mbd.getFactoryBeanName());
			isStatic = false;
		} else {
			factoryClass = mbd.getBeanClass();
			isStatic = true;
		}
		Assert.state(factoryClass != null, "Unresolvable factory class");
		factoryClass = ClassUtils.getUserClass(factoryClass);
		Method[] candidates = getCandidateMethods(factoryClass, mbd);
		Method uniqueCandidate = null;
		for (Method candidate : candidates) {
			if (Modifier.isStatic(candidate.getModifiers()) == isStatic && mbd.isFactoryMethod(candidate)) {
				if (uniqueCandidate == null) {
					uniqueCandidate = candidate;
				} else if (isParamMismatch(uniqueCandidate, candidate)) {
					uniqueCandidate = null;
					break;
				}
			}
		}
		mbd.factoryMethodToIntrospect = uniqueCandidate;
	}
public void resolveFactoryMethodIfPossible ( RootBeanDefinition mbd ) { Class < ? > factoryClass ; boolean isStatic ; if ( mbd . getFactoryBeanName ( ) != null ) { factoryClass = this . beanFactory . getType ( mbd . getFactoryBeanName ( ) ) ; isStatic = false ; } else { factoryClass = mbd . getBeanClass ( ) ; isStatic = true ; } Assert . state ( factoryClass != null , "Unresolvable factory class" ) ; factoryClass = ClassUtils . getUserClass ( factoryClass ) ; Method [ ] candidates = getCandidateMethods ( factoryClass , mbd ) ; Method uniqueCandidate = null ; for ( Method candidate : candidates ) { if ( Modifier . isStatic ( candidate . getModifiers ( ) ) == isStatic && mbd . isFactoryMethod ( candidate ) ) { if ( uniqueCandidate == null ) { uniqueCandidate = candidate ; } else if ( isParamMismatch ( uniqueCandidate , candidate ) ) { uniqueCandidate = null ; break ; } } } mbd . factoryMethodToIntrospect = uniqueCandidate ; }
Resolve the factory method in the specified bean definition, if possible.
Resolve the factory method in the specified bean definition if possible .