Interface BeanUtils.Converter

Enclosing class:
BeanUtils

public static interface BeanUtils.Converter
Marker interface for converter classes. The real method are determined via reflection. A converter needs to match both the source and the destination bean. If the destination bean has a setter setFoo(FooClass foo) and the converter has a method FooClass convertToFoo(SourceBeanClass sourceBean), then this will be called instead of any getter of the sourceBean.

Note:

  • The declared SourceBeanClass in the converter method can also be a superclass of sourceBeanor an interface implemented by sourceBean
  • If there is a matching method convertToFoo(), it needs to have an appropriate return type or else an IllegalArgumentException will be thrown.