|
|
@@ -24,10 +24,7 @@ import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.sql.Timestamp; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
import static org.springframework.beans.BeanUtils.getPropertyDescriptors; |
|
|
|
|
|
|
@@ -285,4 +282,15 @@ public class JsonUtil { |
|
|
|
throw new JsonParseException("can't convert type " + obj.getClass() + " to json string", e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static SwMap bean2Map(Object obj) { |
|
|
|
return parse(encodeString(obj), SwMap.class); |
|
|
|
} |
|
|
|
|
|
|
|
public static List<SwMap> bean2MapList(Object obj) { |
|
|
|
List<SwMap> list = new ArrayList<>(); |
|
|
|
SwMap[] arr = parse(encodeString(obj), SwMap[].class); |
|
|
|
Collections.addAll(list, arr); |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |