@SuppressWarnings("deprecation") protected Object createNewInstance(BeanInfo beanInfo) throws Throwable { ClassInfo classInfo = beanInfo.getClassInfo(); if (classInfo.isInterface()) { InstanceFactory<?> instanceFactory = instanceFactoryMap.get(classInfo.getType()); if (instanceFactory == null) throw new IllegalArgumentException("Cannot instantiate interface BeanInfo, missing InstanceFactory: " + classInfo); return instanceFactory.instantiate(beanInfo); } return beanInfo.newInstance(); }
/** * Create new instance. * * @param beanInfo the bean info * @return new instance * @throws Throwable for any error */ protected Object createNewInstance(BeanInfo beanInfo) throws Throwable { ClassInfo classInfo = beanInfo.getClassInfo(); if (classInfo.isInterface()) { InstanceFactory instanceFactory = instanceFactoryMap.get(classInfo.getType()); if (instanceFactory == null) throw new IllegalArgumentException("Cannot instantiate interface BeanInfo, missing InstanceFactory: " + classInfo); return instanceFactory.instantiate(beanInfo); } return beanInfo.newInstance(); }
/** * Create new instance. * * @param beanInfo the bean info * @return new instance * @throws Throwable for any error */ @SuppressWarnings("deprecation") protected Object createNewInstance(BeanInfo beanInfo) throws Throwable { ClassInfo classInfo = beanInfo.getClassInfo(); if (classInfo.isInterface()) { InstanceFactory<?> instanceFactory = instanceFactoryMap.get(classInfo.getType()); if (instanceFactory == null) throw new IllegalArgumentException("Cannot instantiate interface BeanInfo, missing InstanceFactory: " + classInfo); return instanceFactory.instantiate(beanInfo); } return beanInfo.newInstance(); }