package Edo.util;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import flexjson.*;
import flexjson.transformer.*;

public class JSON {
	public static String encode(Object obj) {
		JSONSerializer serializer = new JSONSerializer(); 		
		serializer.transform(new DateTransformer("yyyy-MM-dd'T'HH:mm:ss"), Date.class);
		return serializer.deepSerialize(obj); 
	}
	public static Object decode(String json) {
		JSONDeserializer deserializer = new JSONDeserializer(); 
		deserializer.use(String.class, new DateTransformer("yyyy-MM-dd'T'HH:mm:ss"));		
		return deserializer.deserialize(json);
	}
}
