Package org.qiunet.utils.convert
Enum Class ConvertManager
- All Implemented Interfaces:
Serializable,Comparable<ConvertManager>,Constable,IApplicationContextAware
配置文件里面的字段对象转换器
- Author:
- qiunet 2020-02-04 13:09
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescription按照指定的class 类型转换strvoidcovertAndSet(Object instance, Field field, String val) 转换并且set到字段.List<? extends BaseObjConvert>static ConvertManagerintorder()越大执行越靠前 第一梯队 KeyValManager(只要context赋值) CfgFieldObjConvertManager (不影响其它) 第二梯队 ConfigContext 第三梯队 EventManager(很多类初始化, 读取配置了) ChannelDataMapping 第四梯队 CfgScannerManager ServerNodeManager0 第五梯队 其它.部分只有某个场合执行.voidsetApplicationContext(IApplicationContext context, ArgsContainer argsContainer) 可以传入一些参数给context 有需要.可以自己覆盖该方法.static ConvertManagerReturns the enum constant of this class with the specified name.static ConvertManager[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
instance
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getInstance
-
scannerType
Description copied from interface:IApplicationContextAware部分只有某个场合执行. 做下区分- Specified by:
scannerTypein interfaceIApplicationContextAware- Returns:
-
covertAndSet
转换并且set到字段.- Parameters:
instance-field-val-
-
convert
按照指定的class 类型转换str- Parameters:
field-val-- Returns:
- 没有转换器将抛出异常
-
setApplicationContext
Description copied from interface:IApplicationContextAware可以传入一些参数给context 有需要.可以自己覆盖该方法.- Specified by:
setApplicationContextin interfaceIApplicationContextAware
-
getConverts
-
order
public int order()Description copied from interface:IApplicationContextAware越大执行越靠前 第一梯队 KeyValManager(只要context赋值) CfgFieldObjConvertManager (不影响其它) 第二梯队 ConfigContext 第三梯队 EventManager(很多类初始化, 读取配置了) ChannelDataMapping 第四梯队 CfgScannerManager ServerNodeManager0 第五梯队 其它. 没有顺序要求的- Specified by:
orderin interfaceIApplicationContextAware- Returns:
-