code: protected BeanDefinition registerBean(Definition def, BindRegistry registry) {
      BeanDefinition bd = convert(def);
      if ((def.isAbstract() && def.clazz == null) || FactoryBean.class.isAssignableFrom(def.clazz)) {
        try {
          Class<?> target = def.targetClass;
  
          if (null == target && def.clazz != null)
            target = ((FactoryBean<?>) def.clazz.newInstance()).getObjectType();
          Assert.isTrue(null != target || def.isAbstract(), "Concrete bean [%1$s] should has class.",
              def.beanName);
  
          registry.register(target, def.beanName, bd);
          // register concrete factory bean
          if (!def.isAbstract()) registry.register(def.clazz, "&" + def.beanName);
        } catch (Exception e) {
          logger.error("Cannot get Factory's Object Type {}", def.clazz);
        }
      } else {
        registry.register(def.clazz, def.beanName, bd);
      }
      logger.debug("Register definition {} for {}", def.beanName, def.clazz);
      return bd;
    }
docs: <p>
  registerBean.
  </p>
  
  @param def bean definition.
  @param registry a {@link org.beangle.commons.inject.bind.BindRegistry} object.
  @return a {@link org.springframework.beans.factory.config.BeanDefinition} object.