com.jchanghong.core.convert.impl.ClassConverter Maven / Gradle / Ivy
The newest version!
package com.jchanghong.core.convert.impl;
import com.jchanghong.core.convert.AbstractConverter;
import com.jchanghong.core.util.ClassUtil;
/**
* 类转换器
* 将类名转换为类
* @author Looly
*
*/
public class ClassConverter extends AbstractConverter> {
private static final long serialVersionUID = 1L;
@Override
protected Class> convertInternal(Object value) {
String valueStr = convertToStr(value);
try {
return ClassUtil.getClassLoader().loadClass(valueStr);
} catch (Exception e) {
// Ignore Exception
}
return null;
}
}