96+ results for 'com.alibaba. fast json' (224 ms)
73 // or another lib? 74// byte[] json = com.alibaba.fastjson.JSON.toJSONString(item, com.alibaba.fastjson.serializer.SerializerFeature.WriteEnumUsingToString).getBytes("UTF-8"); 75 141 msg = "Deserialize, manual, JSON"; 142 sum += testDeser(jsonMapper.getJsonFactory(), json, REPS); 143 break; 146 msg = "Deserialize, manual/FAST, JSON"; 147 sum += testDeserFaster(jsonMapper.getJsonFactory(), json, REPS); 148 break; 174 msg = "Deserialize, fast-json"; 175 sum += testFastJson(json, REPS); 176 break; 232 for (int i = 0; i < reps; ++i) { 233 item = com.alibaba.fastjson.JSON.parseObject(input, MediaItem.class); 234 }XStreamLoopTest.java git://github.com/pangwu86/XBlink.git | Java | 165 lines
11 12import com.alibaba.fastjson.JSON; 13import com.alibaba.fastjson.serializer.SerializerFeature; 119 public void toJSON1() throws Exception { 120 String json = JSON.toJSONString(getLoopA(), SerializerFeature.PrettyFormat); 121 System.out.println(json); 125 public void toJSON1_2() throws Exception { 126 String json = JSON.toJSONString(getLoopC(), SerializerFeature.PrettyFormat); 127 System.out.println(json); 137 public void toJSON2() throws Exception { 138 String json = JSON.toJSONString(getLoopA2(), SerializerFeature.PrettyFormat); 139 System.out.println(json); 154 public void toJSON3() throws Exception { 155 String json = JSON.toJSONString(getLoopA3(), SerializerFeature.PrettyFormat); 156 System.out.println(json);BaseController.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 421 lines
27 28import com.alibaba.fastjson.JSON; 29import com.fdhay.authcenter.common.Constants; 57 private String FREEMARKER_SUFFIX = ".ftl"; 58 private String CONTENT_TYPE_OF_JSON = "text/html; charset=utf-8";//fix IE ajax fileupload issue, so change type from application/json to text/html 59 private String CONTENT_TYPE_OF_TEXT = "text/plain; charset=utf-8"; 197 * <p> 198 * Eg: "message/message-info", ".json" 表示使用页面 /WEB-INF/view/message/message-info.ftl 199 * </p> 258 public ModelAndView toJSON(Object javaObject){ 259 return sendToClient(CONTENT_TYPE_OF_JSON, JSON.toJSONString(javaObject)); 260 }BaseController.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 421 lines
27 28import com.alibaba.fastjson.JSON; 29import com.fdhay.authcenter.proxy.domain.User; 57 private String FREEMARKER_SUFFIX = ".ftl"; 58 private String CONTENT_TYPE_OF_JSON = "text/html; charset=utf-8";//fix IE ajax fileupload issue, so change type from application/json to text/html 59 private String CONTENT_TYPE_OF_TEXT = "text/plain; charset=utf-8"; 197 * <p> 198 * Eg: "message/message-info", ".json" 表示使用页面 /WEB-INF/view/message/message-info.ftl 199 * </p> 258 public ModelAndView toJSON(Object javaObject){ 259 return sendToClient(CONTENT_TYPE_OF_JSON, JSON.toJSONString(javaObject)); 260 }SessionServiceImpl.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 100 lines
13 14import com.alibaba.fastjson.JSON; 15import com.fdhay.authcenter.proxy.domain.User; 37 Map<String, String> map = redisService.getRedisMap(getRedisMapKeyForLoginUser(cookie)); 38 String userJson = map.get(cookie); 39// if(user == null){ 43// } 44 return JSON.parseObject(userJson, User.class); 45 }catch(Exception e){ 55 RedisMap<String, String> map = redisService.getRedisMap(redisMapKey); 56 map.put(cookie, JSON.toJSONString(user)); 57 int timeout = Integer.parseInt(REDIS_LOGIN_USER_TIMEOUT_MINUTES);SessionServiceImpl.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 101 lines
13 14import com.alibaba.fastjson.JSON; 15import com.fdhay.authcenter.common.Constants; 33 Map<String, String> map = redisService.getRedisMap(getRedisMapKeyForLoginUser(cookie)); 34 User user = JSON.parseObject(map.get(cookie), User.class); 35 return user; 46 RedisMap<String, String> map = redisService.getRedisMap(redisMapKey); 47 map.put(cookie, JSON.toJSONString(user)); 48 int timeout = Integer.parseInt(REDIS_LOGIN_USER_TIMEOUT_MINUTES);AgencyFetcherApp.java https://github.com/lotomer/tomstools.git | Java | 213 lines
21 22import com.alibaba.fastjson.JSONArray; 23import com.alibaba.fastjson.JSONObject; 76 } 77 JSONObject obj = (JSONObject) JSONObject.parse(htmlContent); 78 LOG.info("total:" + obj.get("total")); 78 LOG.info("total:" + obj.get("total")); 79 JSONArray arr = obj.getJSONArray("list"); 80 LOG.info("fetch:"+arr.size()); 86 for (int i = 0; i < arr.size(); ++i) { 87 JSONObject o = (JSONObject) arr.get(i); 88 htmlContent = fetcher.fetchHTMLContent(String.format(urlStep2, o.get("SYMBOL"),o.get("SMEBTSTOCK11"),BaseHttpClient.java https://gitlab.com/chgocn/AndPlug.git | Java | 193 lines
3import android.content.Context; 4import com.alibaba.fastjson.JSON; 5import com.loopj.android.http.AsyncHttpClient; 21public abstract class BaseHttpClient { 22 protected final static String CONTENT_TYPE_JSON = "application/json"; 23 protected final static String CONTENT_TYPE_XML = "application/xml"; 110 // [+] post entity 111 public static void postJSON(Context context, String url, JSON json, AsyncHttpResponseHandler responseHandler) { 112 postJSON(false, context, url, json, responseHandler); 114 115 public static void postJSON(boolean async, Context context, String url, JSON json, AsyncHttpResponseHandler responseHandler) { 116 ByteArrayEntity entity = new ByteArrayEntity(json.toString().getBytes()); 124 125 public static void postJSON(boolean async, String url, JSON json, AsyncHttpResponseHandler responseHandler) { 126 postJSON(async, null, url, json, responseHandler);OrganizationController.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 251 lines
24 25import com.alibaba.fastjson.JSON; 26import com.fdhay.authcenter.proxy.domain.annotation.Authorization; 34import com.to211.domain.WebDesignDTO; 35import com.to211.domain.base.json.JsonMessage; 36import com.to211.domain.enums.JsonMessageResultStatusEnum; 70 if(StringUtils.isNotEmpty(errorMsg.toString())){ 71 JsonMessage message = JsonMessage.fail(); 72 message.setResult("注册错误:" + errorMsg.toString()); 87 } 88 JsonMessage apiResponseMessage = JSON.parseObject(apiResponseJson, JsonMessage.class); 89 if(JsonMessageResultStatusEnum.FAIL.equals(apiResponseMessage.getResultStatusCode())){ 105 logger.error(e); 106 JsonMessage message = JsonMessage.fail(); 107 message.setResult("注册失败");BaseQuery.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 119 lines
5 6import com.alibaba.fastjson.annotation.JSONField; 7 9public class BaseQuery { 10 @JSONField(serialize=false) 11 private Map<String, String> searchData = new HashMap<String, String>(); 12 //数据查询范围的开始索引位置 13 @JSONField(serialize=false) 14 private int startIndex; 15 //数据查询范围的结束索引位置 16 @JSONField(serialize=false) 17 private int endIndex; 18 //数据查询范围大小:等于结束索引 - 开始索引 19 @JSONField(serialize=false) 20 private int indexRange;memcachedHelper.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 111 lines
4 5import com.alibaba.fastjson.annotation.JSONType; 6import com.danga.MemCached.MemCachedClient;Sharing.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 172 lines
14 15import com.alibaba.fastjson.annotation.JSONField; 16 117 118 @JSONField(serialize = false) 119 public String getRequirements() { 134 135 @JSONField(serialize = false) 136 public boolean isAvalible() { 139 140 @JSONField(serialize = false) 141 public boolean getAvalible() { 148 149 @JSONField(serialize = false) 150 public int getBorrowedTimes() {PermissionInterceptor.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 207 lines
8 9import com.alibaba.fastjson.JSONArray; 10import com.alibaba.fastjson.JSONObject; 148 /** 149 * Convert JSON string to messageAndResult map 150 * @param messageAndResultStr is something like : [{role: "Book.Provider", msg: "you've shared this book", result: "input"}] 152 public void setMessageAndResult(String messageAndResultStr) { 153 JSONArray array = JSONArray.parseArray(messageAndResultStr); 154 Iterator<?> i = array.iterator(); 154 Iterator<?> i = array.iterator(); 155 JSONObject obj = null; 156 while(i.hasNext()) { 156 while(i.hasNext()) { 157 obj = (JSONObject) i.next(); 158 this.messageAndResult.put(RoleParser.parseString(obj.getString("role"))OrganizationRegisterServiceImpl.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 207 lines
13 14import com.alibaba.fastjson.JSON; 15import com.fdhay.authcenter.common.Constants; 58 @Override 59 public void initOrganizationRegister(OrganizationRegister organizationRegister, User loginUser, String JsonDataTemplate){ 60 //json数据包含初始化的用户组和用户组角色配置 60 //json数据包含初始化的用户组和用户组角色配置 61 OrganizationRegister.ApproveDataTemplate dataTpl = JSON.parseObject(JsonDataTemplate, OrganizationRegister.ApproveDataTemplate.class); 62 //初始化机构数据JsonResponse.java https://gitlab.com/dannyblue/danny-project.git | Java | 334 lines
3import com.alibaba.fastjson.JSON; 4import com.alibaba.fastjson.JSONObject; 5import com.alibaba.fastjson.serializer.SerializerFeature; 157 result.put("data", object); 158 String jsonString = JSON.toJSONString(result, features); 159 return JSON.parse(jsonString); 177 result.put("errorCode", 0); 178 return JSON.toJSONString(result, features); 179 } 224 result.put("data", params); 225 return JSON.parse(JSON.toJSONString(result, features)); 226 } 314 //消除fastjson对同一对象循环引用的问题 315 String jsonString = JSON.toJSONString(result, features); 316 return JSON.parse(jsonString);DoubanServiceImpl.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 200 lines
12 13import com.alibaba.fastjson.JSON; 14import com.alibaba.fastjson.JSONArray; 14import com.alibaba.fastjson.JSONArray; 15import com.alibaba.fastjson.JSONObject; 16import com.jieshuhuiyou.entity.Book; 91 Book book = new Book(); 92 JSONObject jsonObject = JSON.parseObject(jsonStr); 93 if(!jsonObject.containsKey("title")) { 125 // set attributes (isbn10, isbn13, author-intro, price, publisher, publishdate, pages, traslator) 126 JSONArray attributes = jsonObject.getJSONArray("db:attribute"); 127 JSONObject attrItem = null; 180 //set image 181 JSONArray links = jsonObject.getJSONArray("link"); 182 JSONObject linkItem = null;WritablePractice.java https://gitlab.com/doctorwho1986/doctor.git | Java | 86 lines
11 12import com.alibaba.fastjson.JSON; 13import com.google.common.base.Preconditions; 79 public String toString() { 80 return JSON.toJSONString(this); 81 }CfgValueViewer2.java https://gitlab.com/BGCX261/zk-full-demo-git.git | Java | 521 lines
20 21import com.alibaba.fastjson.JSON; 22 370 Object json = CfgParser.toJson(cfgValue, true); 371 String jsonStr = json == null ? "" : JSON.toJSONString(json, true); 372 Textbox v = new Textbox(); 376 v.setHeight("100%"); 377 v.setValue(jsonStr); 378 createDialog(v, "查看数据");NoteController.java https://github.com/Eric-Sun/nooote.git | Java | 314 lines
15 16import com.alibaba.fastjson.JSON; 17import com.b13.nooote.core.ResultDTO; 69 d.noteId = noteId; 70 new ResponseWritter(resp).write(JSON.toJSONString(new ResultDTO(d))).end(); 71 return null; 146 147 new ResponseWritter(resp).write(JSON.toJSONString(new ResultDTO(ndto))).end(); 148 return null; 215 216 new ResponseWritter(resp).write(JSON.toJSONString(new ResultDTO(returnList))).end(); 217 return null; 255 d.size = size; 256 new ResponseWritter(resp).write(JSON.toJSONString(new ResultDTO(d))).end(); 257 return null;WebConfig.java https://gitlab.com/doctorwho1986/doctor.git | Java | 131 lines
27import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; 28import com.alibaba.fastjson.support.spring.FastJsonJsonView; 29 70 public void extendMessageConverters(List<HttpMessageConverter<?>> converters) { 71 converters.add(new FastJsonHttpMessageConverter()); 72 } 103 104 // contentNegotiationManagerFactoryBean.addMediaType("json", MediaType.APPLICATION_JSON); 105 // contentNegotiationManagerFactoryBean.addMediaType("html", MediaType.TEXT_HTML); 105 // contentNegotiationManagerFactoryBean.addMediaType("html", MediaType.TEXT_HTML); 106 // contentNegotiationManagerFactoryBean.setDefaultContentType(MediaType.APPLICATION_JSON); 107 127 128 contentNegotiatingViewResolver.setDefaultViews(Arrays.asList(new FastJsonJsonView())); 129 return contentNegotiatingViewResolver;UserAPI.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 79 lines
11 12import com.alibaba.fastjson.JSON; 13import com.fdhay.authcenter.common.util.security.CookieUtils; 17import com.fdhay.authcenter.domain.annotation.Authorization; 18import com.fdhay.authcenter.domain.base.json.JsonMessage; 19import com.fdhay.authcenter.domain.enums.AuthorizationType; 33 public ModelAndView getLoginUserIfCookieValid(String cookie){ 34 JsonMessage message = new JsonMessage(JsonMessageResultStatusEnum.SUCESS, ""); 35 try { 41 User user = userService.selectByUserName(loginUserMap.getUserName()); 42 message.setResult(JSON.toJSONString(user)); 43 } catch (Exception e) { 59 public ModelAndView isValidUser(String name, String password){ 60 JsonMessage message = new JsonMessage(JsonMessageResultStatusEnum.SUCESS, "合法用户"); 61 try {FastJsonHttpResponseHandler.java https://gitlab.com/chgocn/AndPlug.git | Java | 237 lines
3import android.util.Log; 4import com.alibaba.fastjson.JSON; 5import com.alibaba.fastjson.JSONArray; 5import com.alibaba.fastjson.JSONArray; 6import com.alibaba.fastjson.JSONException; 7import com.alibaba.fastjson.JSONObject; 14 * Used to intercept and handle the responses from requests made using {@link AsyncHttpClient}, 15 * with automatic parsing into a {@link JSONObject} or {@link JSONArray}. 16 * This class is designed to be passed to get, post, put and delete requests with the 29 /** 30 * Creates new FastJsonHttpResponseHandler, with JSON String encoding UTF-8 31 */ 36 /** 37 * Creates new FastJsonHttpResponseHandler with given JSON String encoding 38 *JsonConverter.java https://gitlab.com/BGCX261/zk-full-demo-git.git | Java | 229 lines
11 12import com.alibaba.fastjson.JSON; 13import com.alibaba.fastjson.JSONArray; 13import com.alibaba.fastjson.JSONArray; 14import com.alibaba.fastjson.JSONObject; 15 94 JSONObject origMap = (JSONObject) origObj; 95 JSONObject newMap = new JSONObject(); 96 for (OutputSchemaInfo valueTypeInfo : typeInfo.getChildren()) { 221 String jsonS = IOUtils.toString(JsonConverter.class.getResource("test/s18.o"), "utf8"); 222 Object json = JSON.parse(jsonS); 223 String xmlStr = IOUtils.toString(JsonConverter.class.getResource("test/s18.xml"), "utf8"); 224 OutputSchemaInfo typeInfo = readOutputSchema(xmlStr); 225 JSONObject newJson = (JSONObject) convert(json, typeInfo); 226 System.out.println(JSON.toJSONString(newJson, true));NotificationDisplayHelper.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 163 lines
2 3import com.alibaba.fastjson.JSON; 4import com.jieshuhuiyou.entity.Notification; 50 51 NewBorrowRequestNotification n = JSON.parseObject(notification.getJsonContent() 52 , NewBorrowRequestNotification.class); 62 63 AcceptBorrowRequestNotification n = JSON.parseObject(notification.getJsonContent() 64 , AcceptBorrowRequestNotification.class); 72 private String returnBookNotificationToHTML() { 73 ReturnBookNotification n = JSON.parseObject(notification.getJsonContent() 74 , ReturnBookNotification.class); 89 private String rejectBorrowRequestNotificationToHTML() { 90 RejectBorrowRequestNotification n = JSON.parseObject(notification.getJsonContent() 91 , RejectBorrowRequestNotification.class);Chapter8PracticeTransportClient.java https://gitlab.com/doctorwho1986/doctor.git | Java | 241 lines
17 18import com.alibaba.fastjson.JSON; 19import com.google.common.collect.Lists; 236 public String toString() { 237 return JSON.toJSONString(this); 238 }AcceptBorrowRequestNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 49 lines
3 4import com.alibaba.fastjson.annotation.JSONCreator; 5import com.alibaba.fastjson.annotation.JSONField; 18 19 @JSONCreator 20 public AcceptBorrowRequestNotification(@JSONField(name = "borrow") Borrow borrow) {CuratorPractice1.java https://gitlab.com/doctorwho1986/doctor.git | Java | 156 lines
25 26import com.alibaba.fastjson.JSON; 27 83 info.put("data", new String(currentData.getData(), StandardCharsets.UTF_8)); 84 info.put("stat", JSON.toJSONString(currentData.getStat())); 85 } 86 87 LOG.info("{msg:'nodeChanged info : {}'}", JSON.toJSONString(info)); 88 104 info.put("data", new String(currentData.getData(), StandardCharsets.UTF_8)); 105 info.put("stat", JSON.toJSONString(currentData.getStat())); 106 130 131 LOG.info("{msg:{} :{}}", message, JSON.toJSONString(info)); 132 }Chapter8Code.java https://gitlab.com/doctorwho1986/doctor.git | Java | 119 lines
12 13import com.alibaba.fastjson.JSON; 14 100 public String toString() { 101 return JSON.toJSONString(this); 102 }Acrm.java https://bitbucket.org/eagleon/restcoffee.git | Java | 353 lines
12 13import com.alibaba.fastjson.JSON; 14import com.bosv.bean.Comment; 46 ArrayList nodeSection = nodeSectionService.getNodeSection(); 47 return JSON.toJSONString(nodeSection); 48 } 61 ArrayList newsgroups = newGroupService.getNewGroup(); 62 return JSON.toJSONString(newsgroups); 63 86 ArrayList news = newsService.getNews(); 87 return JSON.toJSONString(news); 88 } 108 ArrayList node = nodeService.getNode(); 109 return JSON.toJSONString(node); 110 }UserServiceImpl.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 75 lines
9 10import com.alibaba.fastjson.JSON; 11import com.fdhay.authcenter.proxy.domain.User; 11import com.fdhay.authcenter.proxy.domain.User; 12import com.fdhay.authcenter.proxy.domain.base.json.JsonException; 13import com.fdhay.authcenter.proxy.domain.base.json.JsonMessage; 35 String response = HttpClientUtils.post(URL_API_OF_GET_LOGIN_USER_IF_COOKIE_VALID, params, null); 36 JsonMessage result = JSON.parseObject(response, JsonMessage.class); 37 if(JsonMessageResultStatusEnum.FAIL.equals(result.getResultStatusCode())){ 37 if(JsonMessageResultStatusEnum.FAIL.equals(result.getResultStatusCode())){ 38 throw new JsonException(JsonMessageResultStatusEnum.FAIL, response); 39 } 55 String response = HttpClientUtils.post(URL_API_OF_IS_VALID_USER, params, null); 56 JsonMessage result = JSON.parseObject(response, JsonMessage.class); 57 if(JsonMessageResultStatusEnum.FAIL.equals(result.getResultStatusCode())){ElasticsearchGuideClient.java https://gitlab.com/doctorwho1986/doctor.git | Java | 284 lines
30 31import com.alibaba.fastjson.JSON; 32/** 273 public String toString() { 274 return JSON.toJSONString(this); 275 } 279 System.out.println(tweet); 280 Tweet parseObject = JSON.parseObject(tweet.toString(), Tweet.class); 281 System.out.println(parseObject);InvokeResult.scala https://bitbucket.org/yuanxu/sevm.git | Scala | 76 lines
1package evm.rtl 2import com.alibaba.fastjson.JSON 3import scala.reflect.BeanProperty 35 */ 36 def toJson = JSON.toJSONString(this, true) 37AgencyDealDataFetcherApp.java https://github.com/lotomer/tomstools.git | Java | 202 lines
13 14import com.alibaba.fastjson.JSONArray; 15import com.alibaba.fastjson.JSONObject; 98 } 99 JSONObject obj = (JSONObject) JSONObject.parse(htmlContent); 100 logger.info("total:" + obj.get("total")); 100 logger.info("total:" + obj.get("total")); 101 JSONArray arr = obj.getJSONArray("list"); 102 agencyDeal = new AgencyDealDAO(); 103 for (int i = 0; i < arr.size(); ++i) { 104 JSONObject o = (JSONObject) arr.get(i); 105 if (!Utils.isEmpty(date)) {User.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 339 lines
11 12import org.apache.struts2.json.annotations.JSON; 13 13 14import com.alibaba.fastjson.annotation.JSONField; 15import com.jieshuhuiyou.Config; 127 @JSONField(serialize = false) 128 @JSON(serialize = false) 129 public String getDescription() { 155 @JSONField(serialize = false) 156 @JSON(serialize = false) 157 public String getPassword() { 174 175 @JSONField(serialize = false) 176 public int getSharingCount() {OrganizationRegisterAPI.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 92 lines
10 11import com.alibaba.fastjson.JSON; 12import com.fdhay.authcenter.domain.OrganizationRegister; 65 if(StringUtils.isEmpty(organizationRegister.getEmail())){ 66 return toJSON(new JsonMessage(JsonMessageResultStatusEnum.FAIL, "邮件不能为空")); 67 } 68 if(StringUtils.isEmpty(organizationRegister.getPassword())){ 69 return toJSON(new JsonMessage(JsonMessageResultStatusEnum.FAIL, "密码不能为空")); 70 } 75 if(organizationRegister == null){ 76 return toJSON(new JsonMessage(JsonMessageResultStatusEnum.FAIL, "机构申请注册记录不存在")); 77 } 86 87 JsonMessage message = new JsonMessage(JsonMessageResultStatusEnum.SUCESS, JSON.toJSONString(organizationRegister)); 88 return toJSON(message);RejectBorrowRequestNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 54 lines
2 3import com.alibaba.fastjson.annotation.JSONCreator; 4import com.alibaba.fastjson.annotation.JSONField; 17 18 @JSONCreator 19 public RejectBorrowRequestNotification(@JSONField(name = "request") BorrowRequest request) {NewBorrowRequestNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 53 lines
2 3import com.alibaba.fastjson.annotation.JSONCreator; 4import com.alibaba.fastjson.annotation.JSONField; 17 18 @JSONCreator 19 public NewBorrowRequestNotification(@JSONField(name = "request") BorrowRequest request) {OrganizationWebTemplateController.java http://java-hiking.googlecode.com/svn/trunk/ | Java | 253 lines
16 17import com.alibaba.fastjson.JSON; 18import com.fdhay.authcenter.proxy.domain.annotation.Authorization; 27import com.to211.domain.base.Page; 28import com.to211.domain.base.json.JsonMessage; 29import com.to211.service.DirectoryOfWebTemplateService; 72 * 保存用户主页设计 73 * @param jsonData - eg:[{"sectionId": "section_1", "moduleId": "module_1"},...] 74 * @return 77 @Authorization(type=AuthorizationType.AUTHENTICATED) 78 public ModelAndView saveDesign(String jsonData) { 79 try { 178 179 JsonMessage msg = JsonMessage.sucess(); 180 return toJSON(msg);JsonFaster.java http://nutz.googlecode.com/svn/trunk/ | Java | 60 lines
6 7import com.alibaba.fastjson.JSON; 8 13 nutzJson(10000); 14 fastJson(10000); 15 41 String jsonStr = Json.toJson(obj); 42 obj = Json.fromJson(JsonObject.class, jsonStr); 43 } 50 String jsonStr = JSON.toJSONString(obj); 51 obj = JSON.parseObject(jsonStr, JsonObject.class); 52 } 56 Thread.sleep(60*1000); 57 new JsonFaster().json(); 58 }RenderResultAsJsonValve.java https://bitbucket.org/michael_zyh/citrus.git | Java | 123 lines
17 18package com.alibaba.citrus.turbine.pipeline.valve; 19 27import com.alibaba.citrus.service.pipeline.PipelineContext; 28import com.alibaba.citrus.service.pipeline.Valve; 29import com.alibaba.citrus.service.pipeline.support.AbstractValveDefinitionParser; 29import com.alibaba.citrus.service.pipeline.support.AbstractValveDefinitionParser; 30import com.alibaba.fastjson.JSON; 31import org.springframework.beans.factory.annotation.Autowired; 91 String javascriptVariable = getJavascriptVariable(); 92 boolean outputAsJson = javascriptVariable == null; 93 103 Object resultObject = pipelineContext.getAttribute(getResultName()); 104 String jsonResult = JSON.toJSONString(resultObject); 105MapPractice.java https://gitlab.com/doctorwho1986/doctor.git | Java | 85 lines
16 */ 17package com.github.fastjson; 18 26 27import com.alibaba.fastjson.JSON; 28 43 map.put("sex", "man"); 44 String jsonString = JSON.toJSONString(map); 45 System.out.println(jsonString); 46 47 InputStream resourceAsStream = MapPractice.class.getResourceAsStream("/fastjson/map1.json"); 48 String jString = null; 63 64 InputStream resourceAsStream2 = MapPractice.class.getResourceAsStream("/fastjson/map2.json"); 65 String jString2 = null;YamlPractice.java https://gitlab.com/doctorwho1986/doctor.git | Java | 33 lines
9 10import com.alibaba.fastjson.JSON; 11 25 ConfigPractice configPractice = yaml.loadAs(inputStream,ConfigPractice.class); 26 System.out.println(JSON.toJSONString(configPractice)); 27 String dump = yaml.dump(configPractice); 29 LOG.info(dump); 30 LOG.info(JSON.toJSONString(configPractice)); 31 }SimpleBean.java https://gitlab.com/doctorwho1986/doctor.git | Java | 61 lines
8 9import com.alibaba.fastjson.JSON; 10 52 public String toString() { 53 return JSON.toJSONString(this); 54 }AbstractNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 49 lines
4 5import com.alibaba.fastjson.JSON; 6import com.jieshuhuiyou.entity.Notification; 24 notification.setDate(new Date()); 25 notification.setJsonContent(JSON.toJSONString(this)); 26CfgUtil.java https://gitlab.com/BGCX261/zk-full-demo-git.git | Java | 76 lines
18 19import com.alibaba.fastjson.JSON; 20 32 String jsonStr = FileUtils.readFileToString(new File(webapp.getRealPath("/WEB-INF/config.json")), "utf8"); 33 Object json = JSON.parse(jsonStr); 34 configer = CfgParser.buildCfgValue(info, json, 1000, 1);User.java https://gitlab.com/doctorwho1986/doctor.git | Java | 55 lines
4 5import com.alibaba.fastjson.JSON; 6 51 public String toString() { 52 return JSON.toJSONString(this); 53 }ReturnBookNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 69 lines
2 3import com.alibaba.fastjson.annotation.JSONCreator; 4import com.alibaba.fastjson.annotation.JSONField; 19 20 @JSONCreator 21 public ReturnBookNotification(@JSONField(name = "borrow") Borrow borrow 21 public ReturnBookNotification(@JSONField(name = "borrow") Borrow borrow 22 , @JSONField(name = "operator") User operator) { 23 this.borrow = borrow;CancleBorrowRequestNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 49 lines
2 3import com.alibaba.fastjson.annotation.JSONCreator; 4import com.alibaba.fastjson.annotation.JSONField; 17 18 @JSONCreator 19 public CancleBorrowRequestNotification(@JSONField(name = "request") BorrowRequest request) {AbstractEvent.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 36 lines
5 6import com.alibaba.fastjson.JSON; 7import com.jieshuhuiyou.Config; 23 public String toJSONStr(Content content){ 24 return JSON.toJSONString(content); 25 }EvaluatedNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 50 lines
2 3import com.alibaba.fastjson.annotation.JSONCreator; 4import com.alibaba.fastjson.annotation.JSONField; 18 19 @JSONCreator 20 public EvaluatedNotification(@JSONField(name = "borrow") Borrow borrow) {AuthorManagerImplTest.java https://gitlab.com/doctorwho1986/doctor.git | Java | 45 lines
11 12import com.alibaba.fastjson.JSON; 13import com.doctor.entity.Author; 36 Author author = authorManager.queryById(10000L); 37 System.out.println(JSON.toJSONString(author)); 38 }CfgParser.java https://gitlab.com/BGCX261/zk-full-demo-git.git | Java | 354 lines
13import com.alibaba.fastjson.JSONArray; 14import com.alibaba.fastjson.JSONObject; 15 197 } else if (mapJson != null && mapJson instanceof JSONObject) { 198 JSONObject jsonObj = (JSONObject) mapJson; 199 partJson = jsonObj.get(partInfo.getId()); 213 if (listJson != null && listJson instanceof JSONArray) { 214 JSONArray jsonArray = (JSONArray) listJson; 215 for (Object eleJson : jsonArray) { 227 if (mapsJson != null && mapsJson instanceof JSONObject) { 228 JSONObject jsonObj = (JSONObject) mapsJson; 229 for (String key : jsonObj.keySet()) { 242 if (mapsJson != null && mapsJson instanceof JSONObject) { 243 JSONObject jsonObj = (JSONObject) mapsJson; 244 for (String key : jsonObj.keySet()) {SharingDeletedNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 53 lines
2 3import com.alibaba.fastjson.annotation.JSONCreator; 4import com.alibaba.fastjson.annotation.JSONField; 19 20 @JSONCreator 21 public SharingDeletedNotification(@JSONField(name = "sharing") Sharing sharing 21 public SharingDeletedNotification(@JSONField(name = "sharing") Sharing sharing 22 , @JSONField(name = "user") User user) { 23 this.sharing = sharing;AcceptBorrowRequestToOtherNotification.java https://bitbucket.org/psjay/ants-bookbase.git | Java | 53 lines
2 3import com.alibaba.fastjson.annotation.JSONCreator; 4import com.alibaba.fastjson.annotation.JSONField; 18 19 @JSONCreator 20 public AcceptBorrowRequestToOtherNotification(@JSONField(name = "request") BorrowRequest request) {SysUser.java https://gitlab.com/dannyblue/danny-project.git | Java | 199 lines
19 20import com.alibaba.fastjson.annotation.JSONField; 21 144 145 @JSONField(serialize=false) 146 @ManyToMany(fetch = FetchType.LAZY)JSONParser.java https://github.com/lotomer/tomstools.git | Java | 74 lines
8 9import com.alibaba.fastjson.JSON; 10import com.alibaba.fastjson.JSONObject; 21 public Element parse(String content, String param) { 22 JSONObject obj = JSON.parseObject(content); 23 if (null != obj){ 23 if (null != obj){ 24 return new JsonElement(obj.getJSONObject(param)); 25 }else{ 30// public void parse(String content, Map<String, String> params, ContentHandle handle) { 31// JSONObject obj = JSON.parseObject(content); 32// if (null != obj){ 33// for (Entry<String, String> entry : params.entrySet()) { 34// handle.handle(entry.getKey(), new JsonElement(obj.getJSONObject(entry.getValue()))); 35// }Blog.java https://bitbucket.org/eagleon/restcoffee.git | Java | 56 lines
21 22import com.alibaba.fastjson.JSON; 23import com.bosv.web.Mapping; 40 41 return JSON.toJSONString(hm); 42 //return "<h1>hello,world!</h1>";ReceiveWarnServiceImpl.java https://gitlab.com/dannyblue/danny-project.git | Java | 223 lines
19 20import com.alibaba.fastjson.JSON; 21import com.sunwave.app.dao.SlAreaDAO; 88 // 调用websocket广播消息,暂未处理目标权限 89 String jsonString = JSON.toJSONString(slInvade); 90 sendMsg(areaId,"WARN_LOGIN|" + jsonString); 119 // 调用websocket广播消息,暂未处理目标权限 120 String jsonString = JSON.toJSONString(slMsg); 121 sendMsg(areaId,"WARN_SMS|" + jsonString); 142 // 调用websocket广播消息,暂未处理目标权限 143 String jsonString = JSON.toJSONString(slCall); 144 sendMsg(areaId,"WARN_CALL|" + jsonString);UserController.java https://github.com/Eric-Sun/nooote.git | Java | 78 lines
11 12import com.alibaba.fastjson.JSON; 13import com.b13.nooote.core.ResultDTO; 71// req.getSession().setAttribute("userId", userId); 72 new ResponseWritter(resp).write(JSON.toJSONString(dto)).end(); 73 return null;FastJsonSerializer.java https://bitbucket.org/seanzxx/serialization-benchmark.git | Java | 30 lines
2 3import com.alibaba.fastjson.JSON; 4import com.alibaba.fastjson.parser.Feature; 4import com.alibaba.fastjson.parser.Feature; 5import com.alibaba.fastjson.serializer.SerializerFeature; 6 9 10public class FastJsonSerializer implements Serializer { 11 12 public String getName() { 13 return "FastJson"; 14 } 16 public void serialize(Object data, OutputStream outputStream) throws Exception { 17 byte[] bytes = JSON.toJSONBytes(data, SerializerFeature.DisableCircularReferenceDetect); 18News.java https://bitbucket.org/eagleon/restcoffee.git | Java | 63 lines
2 3import com.alibaba.fastjson.annotation.JSONField; 4DefaultEchoService.java https://gitlab.com/dannyblue/danny-project.git | Java | 55 lines
22 23import com.alibaba.fastjson.JSONObject; 24 36 if("CONN".equals(msgArray[0])){ 37 JSONObject data = (JSONObject)JSONObject.parse(msgArray[1]); 38 String username = data.get("username").toString();JCClientSendListener.java https://github.com/AL-WUHC2/n3r-mina.git | Java | 54 lines
17 18import com.alibaba.fastjson.JSON; 19 40 logger.info("--------------------------------------------------"); 41 logger.info("[Client Send Message]: " + JSON.toJSONString(result)); 42JCSessionCreateListener.java https://github.com/AL-WUHC2/n3r-mina.git | Java | 35 lines
10 11import com.alibaba.fastjson.JSON; 12 22 23 logger.info("[Session Created Message]: " + JSON.toJSONString(bean)); 24 logger.info("--------------------------------------------------");TextImageUtils.java https://github.com/chenjw/textimage.git | Java | 100 lines
10 11import com.alibaba.fastjson.JSON; 12import com.chenjw.textimage.service.model.TextField; 48 public static TextUrlInfo unmarshalTextUrlInfo(String str) { 49 return JSON.parseObject(str, TextUrlInfo.class); 50 } 67 } 68 String value = JSON.toJSONString(textUrl); 69 return value;JCServerSendListener.java https://github.com/AL-WUHC2/n3r-mina.git | Java | 83 lines
21 22import com.alibaba.fastjson.JSON; 23 52 53 Map respMap = JSON.parseObject(respContent, Map.class); 54 String jobType = parser.getJobType();JCClientReceiveListener.java https://github.com/AL-WUHC2/n3r-mina.git | Java | 37 lines
11 12import com.alibaba.fastjson.JSON; 13 29 30 logger.info("[Client Received Message]: " + JSON.toJSONString(jcMessage.getBean())); 31 logger.info("--------------------------------------------------");JCServerReceiveListener.java https://github.com/AL-WUHC2/n3r-mina.git | Java | 37 lines
11 12import com.alibaba.fastjson.JSON; 13 29 30 logger.info("[Server Received Message]: " + JSON.toJSONString(jcMessage.getBean())); 31 logger.info("--------------------------------------------------");CreateTableTask.java https://github.com/weiganyi/dr-helper.git | Java | 77 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.CreateTableActivity; 47 try { 48 //serialize by fastjson 49 String reqBody = JSON.toJSONString(tableOrderReq); 55 //unserialize from response string 56 OneTableOneOrder tableOrderResp = JSON.parseObject(respBody, OneTableOneOrder.class); 57 if (tableOrderResp != null && 70 }catch(Exception e) { 71 Log.e(CREATE_TABLE_TASK_TAG, "CheckTableTask.doInBackground(): json serialize or http post is failure"); 72 }LoadOrderTask.java https://github.com/weiganyi/dr-helper.git | Java | 81 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.OrderActivity; 52 try { 53 //serialize by fastjson 54 String reqBody = JSON.toJSONString(orderReq); 60 //unserialize from response string 61 OrderInfo orderResp = JSON.parseObject(respBody, OrderInfo.class); 62 if (orderResp != null && 74 }catch(Exception e) { 75 Log.e(LOAD_ORDER_TASK_TAG, "LoadOrderTask.doInBackground(): json serialize or http post is failure"); 76 }UpdateMenuTypeService.java https://github.com/weiganyi/dr-helper.git | Java | 36 lines
5 6import com.alibaba.fastjson.JSON; 7import com.drhelper.android.bean.com.MenuTypeList; 22 respMenuTypeList.setResult(false); 23 respBody = JSON.toJSONString(respMenuTypeList); 24 return respBody; 31 //serialize the object 32 respBody = JSON.toJSONString(respMenuTypeList); 33 return respBody;UpdateMenuService.java https://github.com/weiganyi/dr-helper.git | Java | 36 lines
5 6import com.alibaba.fastjson.JSON; 7import com.drhelper.android.bean.com.MenuList; 22 respMenuList.setResult(false); 23 respBody = JSON.toJSONString(respMenuList); 24 return respBody; 31 //serialize the object 32 respBody = JSON.toJSONString(respMenuList); 33 return respBody;JsonRtnUtil.java https://github.com/zaiqingchen/wechat-mp-sdk.git | Java | 77 lines
7 8import com.alibaba.fastjson.JSONObject; 9 32 */ 33 public static <T extends JsonRtn> T parseJsonRtn(String jsonRtn, Class<T> jsonRtnClazz) { 34 T rtn = JSONObject.parseObject(jsonRtn, jsonRtnClazz); 44 */ 45 private static JsonRtn appendErrorHumanMsg(JsonRtn jsonRtn) { 46 if (bundle == null || jsonRtn == null || StringUtils.isEmpty(jsonRtn.getErrCode())) { 50 try { 51 jsonRtn.setErrHumanMsg(bundle.getString(jsonRtn.getErrCode())); 52 return jsonRtn; 63 */ 64 public static boolean isSuccess(JsonRtn jsonRtn) { 65 if (jsonRtn == null) {LoadOrderService.java https://github.com/weiganyi/dr-helper.git | Java | 51 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.OrderInfo; 17 try{ 18 reqOrder = JSON.parseObject(reqBody, OrderInfo.class); 19 }catch (Exception e) { 19 }catch (Exception e) { 20 System.out.println("LoadOrderService.doAction(): json parse body failure: " + e.getMessage()); 21 return respBody; 37 respOrder.setResult(false); 38 respBody = JSON.toJSONString(respOrder); 39 return respBody; 46 //serialize the object 47 respBody = JSON.toJSONString(respOrder); 48 return respBody;CheckTableTask.java https://github.com/weiganyi/dr-helper.git | Java | 70 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.activity.CheckTableActivity; 53 //unserialize from response string 54 emptyTableListResp = JSON.parseObject(respBody, EmptyTableList.class); 55 if (emptyTableListResp != null && emptyTableListResp.isResult() == true) { 63 }catch(Exception e) { 64 Log.e(CHECK_TABLE_TASK_TAG, "CheckTableTask.doInBackground(): json serialize or http post is failure"); 65 }ChangeTableService.java https://github.com/weiganyi/dr-helper.git | Java | 53 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.TwoTableOneOrder; 16 try{ 17 reqTable = JSON.parseObject(reqBody, TwoTableOneOrder.class); 18 }catch (Exception e) { 18 }catch (Exception e) { 19 System.out.println("ChangeTableService.doAction(): json parse body failure: " + e.getMessage()); 20 return respBody; 37 respTable.setResult(false); 38 respBody = JSON.toJSONString(respTable); 39 return respBody; 48 //serialize the object 49 respBody = JSON.toJSONString(respTable); 50 return respBody;SubmitOrderTask.java https://github.com/weiganyi/dr-helper.git | Java | 74 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.OrderActivity; 49 try { 50 //serialize by fastjson 51 String reqBody = JSON.toJSONString(orderReq); 57 //unserialize from response string 58 OrderInfo orderResp = JSON.parseObject(respBody, OrderInfo.class); 59 if (orderResp != null && orderResp.isResult() == true) { 67 }catch(Exception e) { 68 Log.e(SUBMIT_ORDER_TASK_TAG, "SubmitOrderTask.doInBackground(): json serialize or http post is failure"); 69 }DeleteOrderTask.java https://github.com/weiganyi/dr-helper.git | Java | 74 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.OrderActivity; 49 try { 50 //serialize by fastjson 51 String reqBody = JSON.toJSONString(orderReq); 57 //unserialize from response string 58 OrderInfo orderResp = JSON.parseObject(respBody, OrderInfo.class); 59 if (orderResp != null && orderResp.isResult() == true) { 67 }catch(Exception e) { 68 Log.e(DELETE_ORDER_TASK_TAG, "DeleteOrderTask.doInBackground(): json serialize or http post is failure"); 69 }CreateTableService.java https://github.com/weiganyi/dr-helper.git | Java | 52 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.OneTableOneOrder; 16 try{ 17 reqTable = JSON.parseObject(reqBody, OneTableOneOrder.class); 18 }catch (Exception e) { 18 }catch (Exception e) { 19 System.out.println("CreateTableService.doAction(): json parse body failure: " + e.getMessage()); 20 return respBody; 37 respTable.setResult(false); 38 respBody = JSON.toJSONString(respTable); 39 return respBody; 47 //serialize the object 48 respBody = JSON.toJSONString(respTable); 49 return respBody;LoginService.java https://github.com/weiganyi/dr-helper.git | Java | 56 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.Login; 17 try{ 18 reqLogin = JSON.parseObject(reqBody, Login.class); 19 }catch (Exception e) { 19 }catch (Exception e) { 20 System.out.println("LoginService.doAction(): json parse body failure: " + e.getMessage()); 21 return respBody; 38 respLogin.setResult(false); 39 respBody = JSON.toJSONString(respLogin); 40 return respBody; 51 //serialize the object 52 respBody = JSON.toJSONString(respLogin); 53 return respBody;UnionTableService.java https://github.com/weiganyi/dr-helper.git | Java | 53 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.TwoTableOneOrder; 16 try{ 17 reqTable = JSON.parseObject(reqBody, TwoTableOneOrder.class); 18 }catch (Exception e) { 18 }catch (Exception e) { 19 System.out.println("UnionTableService.doAction(): json parse body failure: " + e.getMessage()); 20 return respBody; 37 respTable.setResult(false); 38 respBody = JSON.toJSONString(respTable); 39 return respBody; 48 //serialize the object 49 respBody = JSON.toJSONString(respTable); 50 return respBody;CheckTableService.java https://github.com/weiganyi/dr-helper.git | Java | 61 lines
7 8import com.alibaba.fastjson.JSON; 9import com.drhelper.android.bean.com.EmptyTable; 25 respEmptyTableList.setResult(false); 26 respBody = JSON.toJSONString(respEmptyTableList); 27 return respBody; 56 //serialize the object 57 respBody = JSON.toJSONString(respEmptyTableList); 58 return respBody;CheckOrderService.java https://github.com/weiganyi/dr-helper.git | Java | 64 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.OneTableOneOrder; 17 try{ 18 reqOrder = JSON.parseObject(reqBody, OneTableOneOrder.class); 19 }catch (Exception e) { 19 }catch (Exception e) { 20 System.out.println("CheckOrderService.doAction(): json parse body failure: " + e.getMessage()); 21 return respBody; 59 //serialize the object 60 respBody = JSON.toJSONString(respOrder); 61 return respBody;ChangeTableTask.java https://github.com/weiganyi/dr-helper.git | Java | 79 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.ChangeTableActivity; 52 try { 53 //serialize by fastjson 54 String reqBody = JSON.toJSONString(tableOrderReq); 60 //unserialize from response string 61 TwoTableOneOrder tableOrderResp = JSON.parseObject(respBody, TwoTableOneOrder.class); 62 if (tableOrderResp != null && tableOrderResp.isResult() == true) { 72 }catch(Exception e) { 73 Log.e(CHANGE_TABLE_TASK_TAG, "ChangeTableTask.doInBackground(): json serialize or http post is failure"); 74 }DeleteOrderService.java https://github.com/weiganyi/dr-helper.git | Java | 45 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.OrderInfo; 17 try{ 18 reqOrder = JSON.parseObject(reqBody, OrderInfo.class); 19 }catch (Exception e) { 19 }catch (Exception e) { 20 System.out.println("DeleteOrderService.doAction(): json parse body failure: " + e.getMessage()); 21 return respBody; 40 //serialize the object 41 respBody = JSON.toJSONString(respOrder); 42 return respBody;SubmitOrderService.java https://github.com/weiganyi/dr-helper.git | Java | 45 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.OrderInfo; 17 try{ 18 reqOrder = JSON.parseObject(reqBody, OrderInfo.class); 19 }catch (Exception e) { 19 }catch (Exception e) { 20 System.out.println("SubmitOrderService.doAction(): json parse body failure: " + e.getMessage()); 21 return respBody; 40 //serialize the object 41 respBody = JSON.toJSONString(respOrder); 42 return respBody;GetNoticeService.java https://github.com/weiganyi/dr-helper.git | Java | 65 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.android.bean.com.NoticeDetail; 18 try{ 19 reqNoticeDetail = JSON.parseObject(reqBody, NoticeDetail.class); 20 }catch (Exception e) { 20 }catch (Exception e) { 21 System.out.println("GetNoticeService.doAction(): json parse body failure: " + e.getMessage()); 22 return respBody; 60 //serialize the object 61 respBody = JSON.toJSONString(respNoticeDetail); 62 return respBody;HttpUtil.java https://github.com/zaiqingchen/wechat-mp-sdk.git | Java | 130 lines
28 29import com.alibaba.fastjson.JSONObject; 30import com.google.common.base.Function; 66 67 public static <T extends JsonRtn> T getRequest(WechatRequest request, License license, Class<T> jsonRtnClazz) { 68 return getRequest(request, license, null, jsonRtnClazz); 79 String json = Request.Get(uri).execute().handleResponse(HttpUtil.UTF8_CONTENT_HANDLER); 80 T jsonRtn = JsonRtnUtil.parseJsonRtn(json, jsonRtnClazz); 81 log.info(requestName + " result:\n url={},\n rtn={},\n {}", uri, json, jsonRtn); 93 94 public static <T extends JsonRtn> T postBodyRequest(WechatRequest request, License license, Map<String, String> paramMap, Object requestBody, Class<T> jsonRtnClazz) { 95 if (request == null || license == null || requestBody == null || jsonRtnClazz == null) { 110 111 T jsonRtn = JsonRtnUtil.parseJsonRtn(rtnJson, jsonRtnClazz); 112 log.info(requestName + " result:\n url={},\n body={},\n rtn={},\n {}", uri, body, rtnJson, jsonRtn);LoginTask.java https://github.com/weiganyi/dr-helper.git | Java | 77 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.LoginActivity; 47 try { 48 //serialize by fastjson 49 String reqBody = JSON.toJSONString(loginReq); 55 //unserialize from response string 56 Login loginResp = JSON.parseObject(respBody, Login.class); 57 if (loginResp != null && 70 }catch(Exception e) { 71 Log.e(LOGIN_TASK_TAG, "LoginTask.doInBackground(): json serialize or http post is failure"); 72 }UnionTableTask.java https://github.com/weiganyi/dr-helper.git | Java | 79 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.UnionTableActivity; 52 try { 53 //serialize by fastjson 54 String reqBody = JSON.toJSONString(tableOrderReq); 60 //unserialize from response string 61 TwoTableOneOrder tableOrderResp = JSON.parseObject(respBody, TwoTableOneOrder.class); 62 if (tableOrderResp != null && tableOrderResp.isResult() == true) { 72 }catch(Exception e) { 73 Log.e(UNION_TABLE_TASK_TAG, "UnionTableTask.doInBackground(): json serialize or http post is failure"); 74 }CheckOrderTask.java https://github.com/weiganyi/dr-helper.git | Java | 81 lines
2 3import com.alibaba.fastjson.JSON; 4import com.drhelper.activity.CheckOrderActivity; 51 try { 52 //serialize by fastjson 53 String reqBody = JSON.toJSONString(tableOrderReq); 59 //unserialize from response string 60 OneTableOneOrder tableOrderResp = JSON.parseObject(respBody, OneTableOneOrder.class); 61 if (tableOrderResp != null && 74 }catch(Exception e) { 75 Log.e(CHECK_ORDER_TASK_TAG, "CheckOrderTask.doInBackground(): json serialize or http post is failure"); 76 }UpdateTask.java https://github.com/weiganyi/dr-helper.git | Java | 97 lines
4 5import com.alibaba.fastjson.JSON; 6import com.drhelper.activity.UpdateActivity; 65 //unserialize from response string 66 menuTypeListResp = JSON.parseObject(respBody, MenuTypeList.class); 67 if (menuTypeListResp != null && 73 //unserialize from response string 74 menuListResp = JSON.parseObject(respBody, MenuList.class); 75 if (menuListResp != null && 90 }catch(Exception e) { 91 Log.e(UPDATE_TASK_TAG, "UpdateTask.doInBackground(): json serialize or http post is failure"); 92 }RowDataHttpPipe.java https://github.com/itisaid/otter.git | Java | 345 lines
37 38import com.alibaba.fastjson.JSONReader; 39import com.alibaba.otter.node.etl.common.io.EncryptedData; 41import com.alibaba.otter.node.etl.common.pipe.PipeDataType; 42import com.alibaba.otter.node.etl.common.pipe.exception.PipeException; 43import com.alibaba.otter.node.etl.model.protobuf.BatchProto; 43import com.alibaba.otter.node.etl.model.protobuf.BatchProto; 44import com.alibaba.otter.shared.common.model.config.channel.ChannelParameter.SyncConsistency; 45import com.alibaba.otter.shared.common.model.config.channel.ChannelParameter.SyncMode; 46import com.alibaba.otter.shared.common.model.config.pipeline.Pipeline; 47import com.alibaba.otter.shared.common.utils.ByteUtils; 48import com.alibaba.otter.shared.etl.model.DbBatch; 49import com.alibaba.otter.shared.etl.model.EventColumn; 50import com.alibaba.otter.shared.etl.model.EventData; 51import com.alibaba.otter.shared.etl.model.EventType;MongoDB.java https://github.com/weiganyi/dr-helper.git | Java | 594 lines
9 10import com.alibaba.fastjson.JSON; 11import com.drhelper.common.entity.Detail; 143 if (dbObj != null) { 144 order = JSON.parseObject(dbObj.toString(), Order.class); 145 } 164 if (dbObj != null) { 165 order = JSON.parseObject(dbObj.toString(), Order.class); 166 } 189 if (dbObj != null) { 190 order = JSON.parseObject(dbObj.toString(), Order.class); 191 } 284 if (dbObj != null) { 285 order = JSON.parseObject(dbObj.toString(), Order.class); 286 if (order != null) {NoticeServer.java https://github.com/weiganyi/dr-helper.git | Java | 592 lines
17 18import com.alibaba.fastjson.JSON; 19import com.drhelper.android.bean.NoticeEvent; 240 //send the response 241 String response = JSON.toJSONString(loginResp); 242 ByteBuffer sBuf = TypeConvert.getByteBufferFromString(response); 279 //send the response 280 String response = JSON.toJSONString(logoutResp); 281 ByteBuffer sBuf = TypeConvert.getByteBufferFromString(response); 332 //send the response 333 String response = JSON.toJSONString(subResp); 334 ByteBuffer sBuf = TypeConvert.getByteBufferFromString(response); 349 350 //serialize by fastjson 351 String response = JSON.toJSONString(nhbResp);NoticeService.java https://github.com/weiganyi/dr-helper.git | Java | 582 lines
12 13import com.alibaba.fastjson.JSON; 14import com.drhelper.R; 279 280 //serialize by fastjson 281 String reqBody = JSON.toJSONString(noticeDetailReq); 393 394 //serialize by fastjson 395 String request = JSON.toJSONString(loginReq); 422 423 //serialize by fastjson 424 String request = JSON.toJSONString(logoutReq); 451 //serialize by fastjson 452 String request = JSON.toJSONString(subReq); 453