net.sf.beanlib.spi
Interface BeanPopulatorSpi

All Superinterfaces:
BeanPopulatorBaseSpi
All Known Implementing Classes:
BeanPopulator

public interface BeanPopulatorSpi
extends BeanPopulatorBaseSpi

Bean Populator SPI. This SPI provides various options to control the propagation behavior of JavaBean properties.

Author:
Joe D. Velopar
See Also:
BeanPopulatorBaseSpi

Nested Class Summary
static interface BeanPopulatorSpi.Factory
          Bean Populator Factory SPI, which is used to create a bean populator which can then be used to determine whether a specific JavaBean property should be propagated from a source bean to a target bean.
 
Method Summary
 Transformable getTransformer()
          Returns the transformer used by this bean populator.
 BeanPopulatorSpi initBeanPopulationExceptionHandler(BeanPopulationExceptionHandler beanPopulationExceptionHandler)
          Used to configure a handler to handle any exception thrown.
 BeanPopulatorSpi initBeanPopulatorBaseConfig(BeanPopulatorBaseConfig baseConfig)
          Used to conveniently provide all the other configuration options as a single configuration object.
 BeanPopulatorSpi initBeanSourceHandler(BeanSourceHandler beanSourceHandler)
          Used to configure a call-back (to produce whatever side-effects deemed necessary) that is invoked after the property value has been retrieved from the source bean, but before being propagated across to the target bean.
 BeanPopulatorSpi initDebug(boolean debug)
          Used to control whether debug messages should be logged.
 BeanPopulatorSpi initDetailedPropertyFilter(DetailedPropertyFilter detailedPropertyFilter)
          Used to configure a detailed prperty filter (which has more context information) to determine whether a specific property should be propagated from the source bean to the target bean.
 BeanPopulatorSpi initPropertyFilter(PropertyFilter propertyFilter)
          Used to configure a property filter to determine whether a specific property should be propagated from a source bean to a target bean.
 BeanPopulatorSpi initReaderMethodFinder(BeanMethodFinder readerMethodFinder)
          Used to configure a finder to find the property getter methods of a source JavaBean.
 BeanPopulatorSpi initSetterMethodCollector(BeanMethodCollector setterMethodCollector)
          Used to configure a collector to collect the property setter methods of a target JavaBean.
 BeanPopulatorSpi initTransformer(Transformable transformer)
          Used to configure a transformer to transform a property value read from a source JavaBean into a value to be to set the corresponding property of a target JavaBean.
<T> T
populate()
          Propagates properties from the source JavaBean to the target JavaBean.
 
Methods inherited from interface net.sf.beanlib.spi.BeanPopulatorBaseSpi
getBeanPopulationExceptionHandler, getBeanPopulatorBaseConfig, getBeanSourceHandler, getDetailedPropertyFilter, getPropertyFilter, getReaderMethodFinder, getSetterMethodCollector, isDebug
 

Method Detail

initTransformer

BeanPopulatorSpi initTransformer(Transformable transformer)
Used to configure a transformer to transform a property value read from a source JavaBean into a value to be to set the corresponding property of a target JavaBean.

Parameters:
transformer - is used to transform every property value read from a source JavaBean into a value to be to set the corresponding property of a target JavaBean.
Returns:
the current object (ie this) for method chaining purposes.

getTransformer

Transformable getTransformer()
Returns the transformer used by this bean populator.


populate

<T> T populate()
Propagates properties from the source JavaBean to the target JavaBean.


initPropertyFilter

BeanPopulatorSpi initPropertyFilter(PropertyFilter propertyFilter)
Description copied from interface: BeanPopulatorBaseSpi
Used to configure a property filter to determine whether a specific property should be propagated from a source bean to a target bean.

Specified by:
initPropertyFilter in interface BeanPopulatorBaseSpi
Parameters:
propertyFilter - is similar to DetailedPropertyFilter but with a simpler API that is used to control whether a specific property should be propagated from a source bean to a target bean.
Returns:
the current object (ie this) for method chaining purposes.

initDetailedPropertyFilter

BeanPopulatorSpi initDetailedPropertyFilter(DetailedPropertyFilter detailedPropertyFilter)
Description copied from interface: BeanPopulatorBaseSpi
Used to configure a detailed prperty filter (which has more context information) to determine whether a specific property should be propagated from the source bean to the target bean.

Specified by:
initDetailedPropertyFilter in interface BeanPopulatorBaseSpi
Parameters:
detailedPropertyFilter - is used to control whether a specific property should be propagated from the source bean to the target bean.
Returns:
the current object (ie this) for method chaining purposes.

initBeanSourceHandler

BeanPopulatorSpi initBeanSourceHandler(BeanSourceHandler beanSourceHandler)
Description copied from interface: BeanPopulatorBaseSpi
Used to configure a call-back (to produce whatever side-effects deemed necessary) that is invoked after the property value has been retrieved from the source bean, but before being propagated across to the target bean.

Specified by:
initBeanSourceHandler in interface BeanPopulatorBaseSpi
Parameters:
beanSourceHandler - can be used to act as a call-back (to produce whatever side-effects deemed necessary) after the property value has been retrieved from the source bean, but before being propagated across to the target bean.
Returns:
the current object (ie this) for method chaining purposes.

initReaderMethodFinder

BeanPopulatorSpi initReaderMethodFinder(BeanMethodFinder readerMethodFinder)
Description copied from interface: BeanPopulatorBaseSpi
Used to configure a finder to find the property getter methods of a source JavaBean.

Specified by:
initReaderMethodFinder in interface BeanPopulatorBaseSpi
Parameters:
readerMethodFinder - can be used to find the property getter methods of a source JavaBean.
Returns:
the current object (ie this) for method chaining purposes.

initSetterMethodCollector

BeanPopulatorSpi initSetterMethodCollector(BeanMethodCollector setterMethodCollector)
Description copied from interface: BeanPopulatorBaseSpi
Used to configure a collector to collect the property setter methods of a target JavaBean.

Specified by:
initSetterMethodCollector in interface BeanPopulatorBaseSpi
Parameters:
setterMethodCollector - can be used to collect the property setter methods of a target JavaBean.
Returns:
the current object (ie this) for method chaining purposes.

initDebug

BeanPopulatorSpi initDebug(boolean debug)
Description copied from interface: BeanPopulatorBaseSpi
Used to control whether debug messages should be logged.

Specified by:
initDebug in interface BeanPopulatorBaseSpi
Returns:
the current object (ie this) for method chaining purposes.

initBeanPopulationExceptionHandler

BeanPopulatorSpi initBeanPopulationExceptionHandler(BeanPopulationExceptionHandler beanPopulationExceptionHandler)
Description copied from interface: BeanPopulatorBaseSpi
Used to configure a handler to handle any exception thrown.

Specified by:
initBeanPopulationExceptionHandler in interface BeanPopulatorBaseSpi
Parameters:
beanPopulationExceptionHandler - can be used to handle any exception thrown.
Returns:
the current object (ie this) for method chaining purposes.

initBeanPopulatorBaseConfig

BeanPopulatorSpi initBeanPopulatorBaseConfig(BeanPopulatorBaseConfig baseConfig)
Description copied from interface: BeanPopulatorBaseSpi
Used to conveniently provide all the other configuration options as a single configuration object.

Specified by:
initBeanPopulatorBaseConfig in interface BeanPopulatorBaseSpi
Parameters:
baseConfig - is used to conveniently group all the other initializable options into a single unit.
Returns:
the current object (ie this) for method chaining purposes.