Hi,

now that we have implemented describe() and populate() on DefaultBeanAccessor, cloneBean() and copyProperties(T target) seem very easy to implement. I would realize cloneBean() simply like:

public B cloneBean()
    throws aLotOfExceptions ;-)
{
    @SuppressWarnings( "unchecked" )
    B clone = (B) bean.getClass().newInstance();
DefaultBeanAccessor<B> cloneAccessor = new DefaultBeanAccessor<B>( clone );
    cloneAccessor.populate( this.describe() );
    return clone;
}

copyProperties() can be implemented likewise. Is that really all we have to do, or am I missing something? I've looked at BeanUtils1 and they are handling Maps a little differently by coping all entries. So I guess we have to do the same (to keep the user experience).

Another thing I was winking about is cast(). I don't understand how that is supposed to work. Can it be, that there is an input parameter missing? To make it work it has to be:

public <V> V cast(Class<V> targetType);

Tell me what you think and I'll start implementing the missing methods.

Regards,
Benedikt

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to