类 NkCustomObjectManager
java.lang.Object
cn.nkpro.elcube.co.NkCustomObjectManager
- 所有已实现的接口:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Component
public class NkCustomObjectManager
extends Object
implements org.springframework.context.ApplicationContextAware
自定义对象管理类
它是Spring上下文工厂的代理,由于系统支持多上下文的原因,所有运行时对象从Spring Context中获取时,不能直接调用
BeanFactory.getBean(String)
等一系列方法。
多上下文的目的是为了不同的用户可以调试不同的配置及脚本,参考DebugContextManager
当然了,这个类也做了一些Bean是否存在的基础校验,省去了很多null指针判断的麻烦
Created by bean on 2020/7/24.-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidassertExists(String beanName)<T extends NkCustomObject>
TgetCustomObject(String beanName, Class<T> clazz)getCustomObjectDescriptionList(Class<? extends NkCustomObject> clazz, boolean emptyValue, Predicate<Map.Entry<String,? extends NkCustomObject>> predicate)<T extends NkCustomObject>
TgetCustomObjectIfExists(String beanName, Class<T> clazz)<T extends NkCustomObject>
Map<String,T>getCustomObjects(Class<T> clazz)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
构造器详细资料
-
NkCustomObjectManager
public NkCustomObjectManager()
-
-
方法详细资料
-
getCustomObjects
-
getCustomObjectDescriptionList
public List<NkCustomObjectDesc> getCustomObjectDescriptionList(Class<? extends NkCustomObject> clazz, boolean emptyValue, Predicate<Map.Entry<String,? extends NkCustomObject>> predicate) -
getCustomObject
-
getCustomObjectIfExists
-
assertExists
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- 指定者:
setApplicationContext在接口中org.springframework.context.ApplicationContextAware- 抛出:
org.springframework.beans.BeansException
-