2024年1月11日发(作者:请下载最新控件)
package ndler;import leStatement;import edStatement;import Set;import eption;import ist;import peHandler;import pe;import il;/** *
* Class: *
*
* Description: jsonarray
格式的字符串转换为相应的数组 *
*
* @param *
*/public class JsonArrayTypeHandler extends BaseTypeHandler { @Override public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException { ing(i, (parameter)); } @Override public Object getNullableResult(ResultSet rs, String columnName) throws SQLException { String value = ing(columnName); if (!y() && !("null")) { return rayList(value, ); } return new ArrayList(); } @Override public Object getNullableResult(ResultSet rs, int columnIndex) throws SQLException { String value = ing(columnIndex); if (!y() && !("null")) { return rayList(ing(columnIndex), ); } return new ArrayList(); } @Override public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { String value = ing(columnIndex); if (!y() && !("null")) { return rayList(value, ); } return new ArrayList(); }}`//将JSON字符串反序列化为Java对象列表。
} public r getAttIndex() { return attIndex; } public void setAttIndex(r attIndex) { ex = attIndex; } public r getLevelIndex() { return levelIndex; } public void setLevelIndex(r levelIndex) { ndex = levelIndex; } public List getPerSurveyDesign() { return veyDesign; } public void setPerSurveyDesign(List perSurveyDesign) { veyDesign = perSurveyDesign; } public r getValue() { return ; } public void setValue(r value) { = value; }}测试类:@Test @Rollback(value = false) public void create() { Exemple cbc = new Exemple(); werId(11); LevelIndex(111); List list1 = new ArrayList(); List list2 = new ArrayList(); List list3 = new ArrayList(); (1); (2); (3); (6); (7); (8); (list2); (list3); SurveyDesign(list1); ServiceResult result = (cbc); GsonBuilder gb = new GsonBuilder(); eFormat("yyyy-MM-dd HH:mm:ss"); n(().toJson(result)); }
本文标签:
下载
转换
字符串
序列化
相应
发表评论