BeanMap的create的使用方法

  

package com.rest;

import java.math.BigInteger;

import com.alibaba.fastjson.JSONObject;

import net.sf.cglib.beans.BeanMap;

public class Test {

    public static void main(String args[]) {  
        Pojo pojo = new Pojo();  
        pojo.setIntValue(1);  
        pojo.setBigInteger(new BigInteger("2"));  
        BeanMap map = BeanMap.create(pojo); 
        
        System.out.println(map.get("intValue"));  
        System.out.println(map.keySet());  
        System.out.println(map.values()); 
        
        
        JSONObject owner = new JSONObject();
		owner.put("field", "id");
		owner.put("filter", "IN_LIST");
		owner.put("valueA", "1,2,5,3,8,");
		System.out.println(owner.toJSONString());
        
    }  
}  
  
class Pojo {  
  
    private int        intValue;  
    public int getIntValue() {
		return intValue;
	}
	public void setIntValue(int intValue) {
		this.intValue = intValue;
	}
	public BigInteger getBigInteger() {
		return bigInteger;
	}
	public void setBigInteger(BigInteger bigInteger) {
		this.bigInteger = bigInteger;
	}
	private BigInteger bigInteger;  
} 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章