Class BeanConverter

java.lang.Object
org.miaixz.bus.core.convert.BeanConverter
All Implemented Interfaces:
Serializable, Converter

public class BeanConverter extends Object implements Converter, Serializable
Bean转换器,支持:
 Map = Bean
 Bean = Bean
 ValueProvider = Bean
 
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Field Details

  • Constructor Details

    • BeanConverter

      public BeanConverter()
      构造
    • BeanConverter

      public BeanConverter(CopyOptions copyOptions)
      构造
      Parameters:
      copyOptions - Bean转换选项参数
  • Method Details

    • convert

      public Object convert(Type targetType, Object value) throws ConvertException
      Description copied from interface: Converter
      转换为指定类型 如果类型无法确定,将读取默认值的类型做为目标类型
      Specified by:
      convert in interface Converter
      Parameters:
      targetType - 目标Type,非泛型类使用
      value - 原始值,如果对象实现了此接口,则value为this
      Returns:
      转换后的值
      Throws:
      ConvertException - 转换无法正常完成或转换异常时抛出此异常