A specialized implementation of {@code DefaultParametersHandler} that copiesthe properties of a {@link BuilderParameters} object (passed at constructiontime) onto the object to be initialized.
Using this handler implementation makes specifying default values pretty straight-forward: Just create a corresponding parameters object, initialize it as desired, and pass it to this class. When invoked the handler uses functionality from Commons BeanUtils to copy all properties defined in the associated parameters object onto the target object. This is based on reflection. Properties not available for the target object are silently ignored. If an exception occurs during the copy operation, it is re-thrown as a runtime exception.
Note that there is no default way to create a defensive copy of the passed in parameters object; therefore, the reference is stored. This makes it possible to change the parameters object later on, and the changes will be effective when initializing objects afterwards. Client code should not rely on this feature.
@version $Id: CopyObjectDefaultHandler.java 1624601 2014-09-12 18:04:36Z oheger $ @since 2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|