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 settersetFoo(FooClass foo)
and the converter has a methodFooClass 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 ofsourceBean
or an interface implemented bysourceBean
- If there is a matching method
convertToFoo()
, it needs to have an appropriate return type or else anIllegalArgumentException
will be thrown.