The {@link com.guidewire.pl.system.beansyncer.BeanSyncer} interface defines
the abstract {@link com.guidewire.pl.system.beansyncer.BeanSyncer#sync sync}
method for syncing a source bean against a target bean. To sync two bean
object graphs, clients should generally call one of the static
{@link com.guidewire.pl.system.beansyncer.BeanSyncerImpl}.sync
methods. In addition to the target and source beans, these methods are also
parameterized by an instance of the
{@link com.guidewire.pl.system.beansyncer.PropertySyncHandlerMap} interface,
which controls how each of the bean properties are synced.
Generally, the operation of "syncing" any given property of a source bean with the same property of a target bean involves simply setting the target property value to equal the source property value. However, other "syncing" semantics may be required. For this reason, this package defines a {@link com.guidewire.pl.system.beansyncer.SyncHandler} interface. Different instances of this interface are used during the syncing process to sync different properties. The particular {@link com.guidewire.pl.system.beansyncer.PropertySyncHandlerMap} instance passed to the top-level sync call controls which {@link com.guidewire.pl.system.beansyncer.SyncHandler} is used for each kind of property.
Therefore, when syncing two object graphs, the client's main responsibility is to define the {@link com.guidewire.pl.system.beansyncer.PropertySyncHandlerMap} to use, as well as any custom {@link com.guidewire.pl.system.beansyncer.SyncHandler} implementations that may be required for their particular needs. This package defines a {@link com.guidewire.pl.system.beansyncer.AbstractPropertySyncHandlerMap} implementation and a variety of generic {@link com.guidewire.pl.system.beansyncer.SyncHandler} implementations that may be useful as a starting point.
This package also defines a collection of copy handlers. The difference between a copy handler and a sync handler is that a sync handler is expected to be used to sync two beans of the same type, while copy handlers are not. In the case of a copy handler, the properties defined on the target bean may be a subset of those on the source bean. Hence, the copy handlers are written so as to be no-ops if the property being synced does not exist on the target bean. The {@link com.guidewire.pl.system.beansyncer.AbstractPropertyCopyHandlerMap} may be used in situations where the source and target beans have different types. Unlike the {@link com.guidewire.pl.system.beansyncer.AbstractPropertySyncHandlerMap}, it registers copy handlers instead of sync handlers by default. @see com.guidewire.pl.system.beansyncer.BeanSyncer @see com.guidewire.pl.system.beansyncer.SyncHandler @see com.guidewire.pl.system.beansyncer.PropertySyncHandlerMap @author Paul D'Albora @author Allan Heydon