org.sklsft.commons.mapper.impl.StringArrayToBeanMapperImpl Maven / Gradle / Ivy
package org.sklsft.commons.mapper.impl;
import org.sklsft.commons.mapper.beans.AccessibleField;
import org.sklsft.commons.mapper.beans.MappableBean;
import org.sklsft.commons.mapper.beans.MappableBeanFactory;
import org.sklsft.commons.mapper.interfaces.ObjectArrayToBeanMapper;
/**
* Enables the copy of a bean from an object array
* The object array is here assumed to be a string array
* @author Nicolas Thibault
*
* @param
*/
public class StringArrayToBeanMapperImpl implements ObjectArrayToBeanMapper {
private final MappableBean mappableBean;
public StringArrayToBeanMapperImpl (Class clazz) {
mappableBean = MappableBeanFactory.getMappableBean(clazz);
}
@Override
public T mapFrom(T obj, Object[] stringArray, int startField) {
for (int i = 0;i