根据传入的class和property,取的属性的值
来源:互联网 发布:arcgis10.2 mac版 编辑:程序博客网 时间:2024/06/05 17:58
package com.wen;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.util.ArrayList;
/**
* <p>Title: </p>
* <p>Description:根据传入的class和property,取的属性的值</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class Reflect {
public static String get(Object object, String methodname, int i){
Class cls = object.getClass();
Object ret;
try {
Method method = cls.getMethod(methodname, null);
ret = method.invoke(cls.newInstance(), null);
ArrayList array = new ArrayList();
if (ret.getClass().isArray()) {
ret = Array.get(ret, i);
}
} catch (Exception e) {
ret = null;
}
if(ret == null){
return null;
}
return ret.toString();
}
}
- 根据传入的class和property,取的属性的值
- 根据input 标签取value属性的值
- ios的@property属性和@synthesize属性
- ios的@property属性和@synthesize属性
- ios的@property属性和@synthesize属性
- ios的@property属性和@synthesize属性
- ios的@property属性和@synthesize属性
- ios的@property属性和@synthesize属性
- ios的@property属性和@synthesize属性
- ios的@property属性和@synthesize属性
- 根据对象的某个属性给他个class属性
- 通过NSURLSessionConfiguration对类属性property(class)的思考
- js中怎么根据数组对象中的两个属性来取第三个属性的值
- iphone的property属性
- @property的属性参数
- ios的@property属性
- android的property属性
- NSArray 的@property属性
- DataGrid资料
- 统计在线人数
- 一个分页组件
- 一个获得随机数的类
- WAP开发教程
- 根据传入的class和property,取的属性的值
- 一个Str类
- 提供 IO 操作的工具类
- 九九歌
- DES加密
- 一个ByteVector类
- 一个dbDataSource类
- PHP PEAR/HTML/QuickForm实现用户注册表单界面
- 第八套广播体操 和 眼保健操