| | |
| | | package com.iailab.module.model.mdk.factory; |
| | | |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity; |
| | | import com.iailab.module.model.mdk.predict.PredictItemHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | |
| | | * @param itemId |
| | | * @return |
| | | */ |
| | | public Object create(String itemId) { |
| | | public PredictItemHandler create(String itemId) { |
| | | MmItemTypeEntity itemTypeEntity = itemEntityFactory.getMmItemTypeEntity(itemId); |
| | | //获取预测项的预测程序的类 |
| | | Object itemObject = null; |
| | | try { |
| | | Class clazz = Class.forName(itemTypeEntity.getItemclasstype()); |
| | | Class<?> clazz = Class.forName(itemTypeEntity.getItemclasstype()); |
| | | itemObject = applicationContext.getBean(clazz); |
| | | } catch (Exception e) { |
| | | log.error("exception message : {}", e.getMessage()); |
| | | } |
| | | return itemObject; |
| | | return (PredictItemHandler) itemObject; |
| | | } |
| | | } |