com.j2mvc.framework.dao.callback.ObjectFieldsValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of j2mvc-framework-app Show documentation
Show all versions of j2mvc-framework-app Show documentation
强烈建议使用J2mvc 2.1以后的版本。
version 2.1.01
1.更换JSON依赖包.
version 2.1.02
1.移除com.j2mvc.StringUtils.getUtf8()方法调用.
更改为getCharset()
version 2.1.03
1.更新JNDI连接设置
version 2.1.04
1.修改works.xml配置url-pkg-prefixes改为pkg
package com.j2mvc.framework.dao.callback;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import com.j2mvc.framework.mapping.Column;
import com.j2mvc.framework.mapping.Foreign;
import com.j2mvc.framework.mapping.PrimaryKey;
import com.j2mvc.framework.util.FieldUtil;
/**
* 读取对象的值
* @author 杨朔
* 2014年1月13日
*/
public class ObjectFieldsValue {
Logger log = Logger.getLogger(getClass().getName());
private Object object;
/**
* 构造器
* @param object
*/
public ObjectFieldsValue(Object object) {
super();
this.object = object;
}
/**
* 读取对象属性值
* Object[]
*/
public Object[] getValues(boolean addKey){
if(object == null)
return null;
List