package com.goafanti.common.utils;

import java.lang.reflect.InvocationTargetException;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;

public class BeanUtilsExt extends BeanUtils {

    private BeanUtilsExt() {
    }

    static {
        ConvertUtils.register(new org.apache.commons.beanutils.converters.DateConverter(null), java.sql.Date.class);
        ConvertUtils.register(new org.apache.commons.beanutils.converters.SqlDateConverter(null), java.util.Date.class);
        ConvertUtils.register(new org.apache.commons.beanutils.converters.SqlTimestampConverter(null), java.sql.Timestamp.class);
        ConvertUtils.register(new org.apache.commons.beanutils.converters.BigDecimalConverter(null) , java.math.BigDecimal.class);
    }

    public static void copyProperties(Object target, Object source) throws InvocationTargetException,
            IllegalAccessException {
        org.apache.commons.beanutils.BeanUtils.copyProperties(target, source);
        
    }
}
