com.easyjf.container.impl
类 BeanCreatorUtil

java.lang.Object
  继承者 com.easyjf.container.impl.BeanCreatorUtil

public class BeanCreatorUtil
extends java.lang.Object

负责创建Bean的工具类,在创建的过程中解决构造子注入

作者:
大峡

构造方法摘要
BeanCreatorUtil()
           
 
方法摘要
static boolean argumentsTypeDiffWith(java.lang.Class[] args, java.lang.Class[] vs)
           
static java.lang.Class[] getArgumentsValueType(int max, ConstructorArgumentValue[] cvs)
           
static java.lang.Object initBean(BeanDefinition beanDefinition, Container container)
           
static boolean isCreateOnStart(BeanDefinition definition)
          判断一个Bean是否需要在容器加载的时候加载,不以&开头,lazy为flase,scope为singleton或application的Bean将会在容器初始化的时候加载
static java.lang.reflect.Constructor resolverConstructor(java.lang.Class type, ConstructorArguments args)
           
static void sortArgumentsValue(ConstructorArgumentValue[] args)
           
static void sortConstructors(java.lang.reflect.Constructor[] constructors)
          Sort the given constructors, preferring public constructors and "greedy" ones with a maximum of arguments.
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

BeanCreatorUtil

public BeanCreatorUtil()
方法详细信息

argumentsTypeDiffWith

public static boolean argumentsTypeDiffWith(java.lang.Class[] args,
                                            java.lang.Class[] vs)

getArgumentsValueType

public static java.lang.Class[] getArgumentsValueType(int max,
                                                      ConstructorArgumentValue[] cvs)

initBean

public static java.lang.Object initBean(BeanDefinition beanDefinition,
                                        Container container)

isCreateOnStart

public static boolean isCreateOnStart(BeanDefinition definition)
判断一个Bean是否需要在容器加载的时候加载,不以&开头,lazy为flase,scope为singleton或application的Bean将会在容器初始化的时候加载

参数:
definition -
返回:
若该定义的bean需要在启动时创建,则返回true,否则返回false

resolverConstructor

public static java.lang.reflect.Constructor resolverConstructor(java.lang.Class type,
                                                                ConstructorArguments args)

sortArgumentsValue

public static void sortArgumentsValue(ConstructorArgumentValue[] args)

sortConstructors

public static void sortConstructors(java.lang.reflect.Constructor[] constructors)
Sort the given constructors, preferring public constructors and "greedy" ones with a maximum of arguments. The result will contain public constructors first, with decreasing number of arguments, then non-public constructors, again with decreasing number of arguments.

参数:
constructors - the constructor array to sort