Enum Class ConvertManager

java.lang.Object
java.lang.Enum<ConvertManager>
org.qiunet.utils.convert.ConvertManager
All Implemented Interfaces:
Serializable, Comparable<ConvertManager>, Constable, IApplicationContextAware

public enum ConvertManager extends Enum<ConvertManager> implements IApplicationContextAware
配置文件里面的字段对象转换器
Author:
qiunet 2020-02-04 13:09
  • Enum Constant Details

  • Method Details

    • values

      public static ConvertManager[] 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

      public static ConvertManager valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getInstance

      public static ConvertManager getInstance()
    • scannerType

      public ScannerType scannerType()
      Description copied from interface: IApplicationContextAware
      部分只有某个场合执行. 做下区分
      Specified by:
      scannerType in interface IApplicationContextAware
      Returns:
    • covertAndSet

      public void covertAndSet(Object instance, Field field, String val)
      转换并且set到字段.
      Parameters:
      instance -
      field -
      val -
    • convert

      public Object convert(Field field, String val)
      按照指定的class 类型转换str
      Parameters:
      field -
      val -
      Returns:
      没有转换器将抛出异常
    • setApplicationContext

      public void setApplicationContext(IApplicationContext context, ArgsContainer argsContainer)
      Description copied from interface: IApplicationContextAware
      可以传入一些参数给context 有需要.可以自己覆盖该方法.
      Specified by:
      setApplicationContext in interface IApplicationContextAware
    • getConverts

      public List<? extends BaseObjConvert> getConverts()
    • order

      public int order()
      Description copied from interface: IApplicationContextAware
      越大执行越靠前 第一梯队 KeyValManager(只要context赋值) CfgFieldObjConvertManager (不影响其它) 第二梯队 ConfigContext 第三梯队 EventManager(很多类初始化, 读取配置了) ChannelDataMapping 第四梯队 CfgScannerManager ServerNodeManager0 第五梯队 其它. 没有顺序要求的
      Specified by:
      order in interface IApplicationContextAware
      Returns: