PageRenderTime 2754ms queryTime 45ms sortTime 0ms getByIdsTime 20ms findMatchingLines 51ms

100+ results results for 'com.alibaba. fast json' (2754 ms)

Not the results you expected?
ServiceInvokeServlet.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 255 lines
                    
29
                    
30import com.alibaba.fastjson.JSON;
                    
31import com.alibaba.fastjson.JSONObject;
                    
192		}
                    
193		resp.setContentType("application/json;charset="+encoding);
                    
194		if(lastModifiedTime!=null){
                    
197		PrintWriter out = resp.getWriter();
                    
198		out.print(JSON.toJSONString(resultMap));
                    
199		resp.flushBuffer();
                    
236		logger.debug("param:" + paramString);
                    
237		JSONObject headers = null;
                    
238		if (StringUtils.isNotEmpty(headerString)) {
                    
238		if (StringUtils.isNotEmpty(headerString)) {
                    
239			headers = JSON.parseObject(headerString);
                    
240		}
                    
                
AbstractRedisTemplate.java https://gitlab.com/Fish-Potato/TTStreet-core | Java | 1124 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.google.common.collect.Lists;
                    
6import com.google.common.collect.Sets;
                    
7import com.tts.util.JsonUtil;
                    
8import org.apache.commons.collections.CollectionUtils;
                    
65        } else {
                    
66            redisValue = JSON.toJSONString(value);
                    
67        }
                    
368        } else {
                    
369            redisValue = JSON.toJSONString(value);
                    
370        }
                    
428        } else {
                    
429            redisValue = JSON.toJSONString(value);
                    
430        }
                    
                
TestMetricTrans.java https://gitlab.com/zhengdingke/gmonitor | Java | 508 lines
                    
36
                    
37import com.alibaba.fastjson.JSON;
                    
38import com.googlecode.jmxtrans.JmxTransformer;
                    
57    private int runPeriod;
                    
58    private File jsonDirOrFile;
                    
59    private boolean runEndlessly;
                    
198        File dirToWatch = null;
                    
199        System.out.println(getJsonDirOrFile().toString());
                    
200        if (getJsonDirOrFile().isFile()) {
                    
268    private void processFilesIntoServers(List<File> jsonFiles) throws LifecycleException {
                    
269        MetricJsonCreateUtil.getAllModuleJsonObj(getJsonDirOrFile().getPath().toString()).stream().forEach(m -> {
                    
270            System.out.println(JSON.toJSONString(m, true));
                    
273            try {
                    
274                process = mapper.readValue(JSON.toJSONString(m), JmxProcess.class);
                    
275            } catch (Exception e) {
                    
                
MetricTrans.java https://gitlab.com/zhengdingke/gmonitor | Java | 535 lines
                    
36
                    
37import com.alibaba.fastjson.JSON;
                    
38import com.googlecode.jmxtrans.JmxTransformer;
                    
50import com.googlecode.jmxtrans.util.WatchedCallback;
                    
51import com.zdingke.gmonitor.utils.MetricJsonCreateUtil;
                    
52
                    
57    private int runPeriod;
                    
58    private File jsonDirOrFile;
                    
59    private boolean runEndlessly;
                    
298    private void processFilesIntoServers(List<File> jsonFiles) throws LifecycleException {
                    
299        MetricJsonCreateUtil.getAllModuleJsonObj(getJsonDirOrFile().getPath().toString()).stream().forEach(m -> {
                    
300            ObjectMapper mapper = new ObjectMapper();
                    
302            try {
                    
303                process = mapper.readValue(JSON.toJSONString(m), JmxProcess.class);
                    
304            } catch (Exception e) {
                    
                
TagUtil.java https://gitlab.com/spiderworts/ab_weixin_cms | Java | 521 lines
                    
25
                    
26import com.alibaba.fastjson.JSONObject;
                    
27
                    
151			if (jsonTemp.lastIndexOf(",") == jsonTemp.length()) {
                    
152				jsonTemp = jsonTemp.deleteCharAt(jsonTemp.length());
                    
153			}
                    
217		jsonTemp.append("]}");
                    
218		return JSONObject.toJSONString(jsonTemp).toString();
                    
219	}
                    
367		ObjectMapper mapper = new ObjectMapper();
                    
368//		JSONObject jsonObject = JSONObject.fromObject(map);
                    
369		try {
                    
406		response.setHeader("Cache-Control", "no-store");
                    
407		JSONObject object = TagUtil.getJson(dataTableReturn,field);
                    
408		try {
                    
                
Utils.java https://gitlab.com/ShaneNilsson/JarToUnity | Java | 961 lines
                    
32
                    
33import com.alibaba.fastjson.JSONObject;
                    
34import com.baseproject.utils.UIUtils;
                    
57				// 字段内容true 代表vip .false代表不是。
                    
58				org.json.JSONObject objContent = BaseHelper.string2JSON(Youku.COOKIE, ";");
                    
59				String yktk = objContent.getString("yktk");
                    
                
CaptureResultAcitvity.java https://gitlab.com/ShaneNilsson/JarToUnity | Java | 528 lines
                    
19
                    
20import com.alibaba.fastjson.JSON;
                    
21import com.example.youkuloginsdk.R;
                    
345				try {
                    
346					saoJson = JSON.parseObject(str, Saosao.class);
                    
347					// Logger.e("二维码", "请求成功 status:" + saoJson.status);
                    
347					// Logger.e("二维码", "请求成功 status:" + saoJson.status);
                    
348					if (null != saoJson && TextUtils.equals("success", saoJson.status)) {
                    
349						// if (saoJson.result.paid == 1) {
                    
353						title.setText(saoJson.result.title);
                    
354						seeToo.setText("观看到:" + YoukuUtil.formatTime(saoJson.result.firsttime));
                    
355						if (saoJson.result.limit >= 4) {
                    
494				Youku.iStaticsManager.getHashMapStyleValue("vid", saoJson.result.videoid), StaticsConfigFile.SCAN_AND_SCAN_VIDEO_PLAY_ENCODE_VALUE);
                    
495		goPlayer(saoJson.result.videoid, saoJson.result.title, (int) saoJson.result.firsttime, saoJson.result.paid == SaosaoResult.PAY_YES);
                    
496	}
                    
                
GenTableServiceImpl.java https://gitlab.com/mrsunchangemyselfsun/ruoyi-vue | Java | 521 lines
                    
23import org.springframework.transaction.annotation.Transactional;
                    
24import com.alibaba.fastjson.JSON;
                    
25import com.alibaba.fastjson.JSONObject;
                    
126    {
                    
127        String options = JSON.toJSONString(genTable.getParams());
                    
128        genTable.setOptions(options);
                    
402        {
                    
403            String options = JSON.toJSONString(genTable.getParams());
                    
404            JSONObject paramsObj = JSONObject.parseObject(options);
                    
                
TypeUtils.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 1049 lines
                    
15 */
                    
16package com.alibaba.fastjson.util;
                    
17
                    
43
                    
44import com.alibaba.fastjson.JSON;
                    
45import com.alibaba.fastjson.JSONException;
                    
45import com.alibaba.fastjson.JSONException;
                    
46import com.alibaba.fastjson.JSONObject;
                    
47import com.alibaba.fastjson.annotation.JSONField;
                    
47import com.alibaba.fastjson.annotation.JSONField;
                    
48import com.alibaba.fastjson.annotation.JSONType;
                    
49import com.alibaba.fastjson.parser.ParserConfig;
                    
49import com.alibaba.fastjson.parser.ParserConfig;
                    
50import com.alibaba.fastjson.parser.deserializer.FieldDeserializer;
                    
51
                    
                
AntiCollisionHashMap.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 1117 lines
                    
1package com.alibaba.fastjson.util;
                    
2
                    
96 * The iterators returned by all of this class's "collection view methods" are
                    
97 * <i>fail-fast</i>: if the map is structurally modified at any time after the
                    
98 * iterator is created, in any way except through the iterator's own
                    
104 * <p>
                    
105 * Note that the fail-fast behavior of an iterator cannot be guaranteed as it
                    
106 * is, generally speaking, impossible to make any hard guarantees in the
                    
106 * is, generally speaking, impossible to make any hard guarantees in the
                    
107 * presence of unsynchronized concurrent modification. Fail-fast iterators throw
                    
108 * <tt>ConcurrentModificationException</tt> on a best-effort basis. Therefore,
                    
109 * it would be wrong to write a program that depended on this exception for its
                    
110 * correctness: <i>the fail-fast behavior of iterators should be used only to
                    
111 * detect bugs.</i>
                    
186	 * rehash). This field is used to make iterators on Collection-views of the
                    
187	 * SafelyHashMap fail-fast. (See ConcurrentModificationException).
                    
188	 */
                    
                
SerializeWriter.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 1536 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
17
                    
18import static com.alibaba.fastjson.parser.CharTypes.replaceChars;
                    
19
                    
26
                    
27import com.alibaba.fastjson.JSON;
                    
28import com.alibaba.fastjson.parser.CharTypes;
                    
28import com.alibaba.fastjson.parser.CharTypes;
                    
29import com.alibaba.fastjson.util.Base64;
                    
30import com.alibaba.fastjson.util.IOUtils;
                    
51    public SerializeWriter(){
                    
52        this.features = JSON.DEFAULT_GENERATE_FEATURE;
                    
53
                    
                
JSONSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 522 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
35
                    
36import com.alibaba.fastjson.JSON;
                    
37import com.alibaba.fastjson.JSONAware;
                    
37import com.alibaba.fastjson.JSONAware;
                    
38import com.alibaba.fastjson.JSONException;
                    
39import com.alibaba.fastjson.JSONStreamAware;
                    
39import com.alibaba.fastjson.JSONStreamAware;
                    
40import com.alibaba.fastjson.util.ServiceLoader;
                    
41
                    
352    public static final void write(SerializeWriter out, Object object) {
                    
353        JSONSerializer serializer = new JSONSerializer(out);
                    
354        serializer.write(object);
                    
                
ASMSerializerFactory.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 1179 lines
                    
2
                    
3import static com.alibaba.fastjson.util.ASMUtils.getDesc;
                    
4import static com.alibaba.fastjson.util.ASMUtils.getType;
                    
16
                    
17import com.alibaba.fastjson.JSONException;
                    
18import com.alibaba.fastjson.annotation.JSONField;
                    
18import com.alibaba.fastjson.annotation.JSONField;
                    
19import com.alibaba.fastjson.asm.ClassWriter;
                    
20import com.alibaba.fastjson.asm.FieldVisitor;
                    
20import com.alibaba.fastjson.asm.FieldVisitor;
                    
21import com.alibaba.fastjson.asm.Label;
                    
22import com.alibaba.fastjson.asm.MethodVisitor;
                    
25import com.alibaba.fastjson.util.ASMUtils;
                    
26import com.alibaba.fastjson.util.FieldInfo;
                    
27import com.alibaba.fastjson.util.TypeUtils;
                    
                
DefaultObjectDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 487 lines
                    
22
                    
23import com.alibaba.fastjson.JSONException;
                    
24import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
24import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
25import com.alibaba.fastjson.parser.DefaultJSONParser.ResolveTask;
                    
26import com.alibaba.fastjson.parser.Feature;
                    
27import com.alibaba.fastjson.parser.JSONLexer;
                    
28import com.alibaba.fastjson.parser.JSONScanner;
                    
29import com.alibaba.fastjson.parser.JSONToken;
                    
29import com.alibaba.fastjson.parser.JSONToken;
                    
30import com.alibaba.fastjson.parser.ParseContext;
                    
31import com.alibaba.fastjson.util.ASMClassLoader;
                    
31import com.alibaba.fastjson.util.ASMClassLoader;
                    
32import com.alibaba.fastjson.util.TypeUtils;
                    
33
                    
                
ASMDeserializerFactory.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 1021 lines
                    
2
                    
3import static com.alibaba.fastjson.util.ASMUtils.getDesc;
                    
4import static com.alibaba.fastjson.util.ASMUtils.getType;
                    
21
                    
22import com.alibaba.fastjson.JSONException;
                    
23import com.alibaba.fastjson.asm.ASMException;
                    
28import com.alibaba.fastjson.asm.Opcodes;
                    
29import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
30import com.alibaba.fastjson.parser.DefaultJSONParser.ResolveTask;
                    
31import com.alibaba.fastjson.parser.Feature;
                    
32import com.alibaba.fastjson.parser.JSONLexer;
                    
33import com.alibaba.fastjson.parser.JSONScanner;
                    
33import com.alibaba.fastjson.parser.JSONScanner;
                    
34import com.alibaba.fastjson.parser.JSONToken;
                    
35import com.alibaba.fastjson.parser.ParseContext;
                    
                
ParserConfig.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 534 lines
                    
15 */
                    
16package com.alibaba.fastjson.parser;
                    
17
                    
56
                    
57import com.alibaba.fastjson.JSONArray;
                    
58import com.alibaba.fastjson.JSONException;
                    
58import com.alibaba.fastjson.JSONException;
                    
59import com.alibaba.fastjson.JSONObject;
                    
60import com.alibaba.fastjson.asm.ASMException;
                    
60import com.alibaba.fastjson.asm.ASMException;
                    
61import com.alibaba.fastjson.parser.deserializer.ASMDeserializerFactory;
                    
62import com.alibaba.fastjson.parser.deserializer.ASMJavaBeanDeserializer;
                    
94import com.alibaba.fastjson.parser.deserializer.IntegerFieldDeserializer;
                    
95import com.alibaba.fastjson.parser.deserializer.JSONArrayDeserializer;
                    
96import com.alibaba.fastjson.parser.deserializer.JSONObjectDeserializer;
                    
                
JSONScanner.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 1746 lines
                    
17
                    
18import static com.alibaba.fastjson.parser.JSONToken.COLON;
                    
19import static com.alibaba.fastjson.parser.JSONToken.COMMA;
                    
19import static com.alibaba.fastjson.parser.JSONToken.COMMA;
                    
20import static com.alibaba.fastjson.parser.JSONToken.EOF;
                    
21import static com.alibaba.fastjson.parser.JSONToken.ERROR;
                    
21import static com.alibaba.fastjson.parser.JSONToken.ERROR;
                    
22import static com.alibaba.fastjson.parser.JSONToken.LBRACE;
                    
23import static com.alibaba.fastjson.parser.JSONToken.LBRACKET;
                    
23import static com.alibaba.fastjson.parser.JSONToken.LBRACKET;
                    
24import static com.alibaba.fastjson.parser.JSONToken.LITERAL_STRING;
                    
25import static com.alibaba.fastjson.parser.JSONToken.LPAREN;
                    
25import static com.alibaba.fastjson.parser.JSONToken.LPAREN;
                    
26import static com.alibaba.fastjson.parser.JSONToken.RBRACE;
                    
27import static com.alibaba.fastjson.parser.JSONToken.RBRACKET;
                    
                
DefaultJSONParser.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 1163 lines
                    
19import static com.alibaba.fastjson.parser.JSONToken.EOF;
                    
20import static com.alibaba.fastjson.parser.JSONToken.ERROR;
                    
21import static com.alibaba.fastjson.parser.JSONToken.FALSE;
                    
22import static com.alibaba.fastjson.parser.JSONToken.LBRACE;
                    
23import static com.alibaba.fastjson.parser.JSONToken.LBRACKET;
                    
24import static com.alibaba.fastjson.parser.JSONToken.LITERAL_FLOAT;
                    
24import static com.alibaba.fastjson.parser.JSONToken.LITERAL_FLOAT;
                    
25import static com.alibaba.fastjson.parser.JSONToken.LITERAL_INT;
                    
26import static com.alibaba.fastjson.parser.JSONToken.LITERAL_STRING;
                    
50
                    
51import com.alibaba.fastjson.JSON;
                    
52import com.alibaba.fastjson.JSONArray;
                    
52import com.alibaba.fastjson.JSONArray;
                    
53import com.alibaba.fastjson.JSONException;
                    
54import com.alibaba.fastjson.JSONObject;
                    
                
Opcodes.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 292 lines
                    
1/***
                    
2 * ASM: a very small and fast Java bytecode manipulation framework
                    
3 * Copyright (c) 2000-2007 INRIA, France Telecom
                    
29 */
                    
30package com.alibaba.fastjson.asm;
                    
31
                    
170    // int    LASTORE             = 80;                     // -
                    
171    // int    FASTORE             = 81;                     // -
                    
172 // int    DASTORE             = 82;                     // -
                    
                
JSON.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 648 lines
                    
29
                    
30import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
31import com.alibaba.fastjson.parser.DefaultJSONParser.ResolveTask;
                    
32import com.alibaba.fastjson.parser.Feature;
                    
33import com.alibaba.fastjson.parser.JSONLexer;
                    
34import com.alibaba.fastjson.parser.JSONToken;
                    
36import com.alibaba.fastjson.parser.deserializer.FieldDeserializer;
                    
37import com.alibaba.fastjson.serializer.JSONSerializer;
                    
38import com.alibaba.fastjson.serializer.NameFilter;
                    
38import com.alibaba.fastjson.serializer.NameFilter;
                    
39import com.alibaba.fastjson.serializer.PropertyPreFilter;
                    
40import com.alibaba.fastjson.serializer.PropertyFilter;
                    
76        features |= com.alibaba.fastjson.serializer.SerializerFeature.SkipTransientField.getMask();
                    
77        features |= com.alibaba.fastjson.serializer.SerializerFeature.WriteEnumUsingToString.getMask();
                    
78        features |= com.alibaba.fastjson.serializer.SerializerFeature.SortField.getMask();
                    
                
FilterUtils.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 297 lines
                    
1package com.alibaba.fastjson.serializer;
                    
2
                    
6
                    
7    public static Object processValue(JSONSerializer serializer, Object object, String key, Object propertyValue) {
                    
8        List<ValueFilter> valueFilters = serializer.getValueFiltersDirect();
                    
17
                    
18    public static String processKey(JSONSerializer serializer, Object object, String key, Object propertyValue) {
                    
19        List<NameFilter> nameFilters = serializer.getNameFiltersDirect();
                    
28
                    
29    public static String processKey(JSONSerializer serializer, Object object, String key, byte intValue) {
                    
30        List<NameFilter> nameFilters = serializer.getNameFiltersDirect();
                    
41
                    
42    public static String processKey(JSONSerializer serializer, Object object, String key, short intValue) {
                    
43        List<NameFilter> nameFilters = serializer.getNameFiltersDirect();
                    
54
                    
55    public static String processKey(JSONSerializer serializer, Object object, String key, int intValue) {
                    
56        List<NameFilter> nameFilters = serializer.getNameFiltersDirect();
                    
                
ArrayListStringDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 109 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
9
                    
10import com.alibaba.fastjson.JSONException;
                    
11import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
12import com.alibaba.fastjson.parser.Feature;
                    
13import com.alibaba.fastjson.parser.JSONLexer;
                    
14import com.alibaba.fastjson.parser.JSONToken;
                    
23        final JSONLexer lexer = parser.getLexer();
                    
24        if (lexer.token() == JSONToken.NULL) {
                    
25            lexer.nextToken(JSONToken.COMMA);
                    
54
                    
55        if (lexer.token() == JSONToken.NULL) {
                    
56            lexer.nextToken(JSONToken.COMMA);
                    
67
                    
68        lexer.nextToken(JSONToken.LITERAL_STRING);
                    
69
                    
                
GangliaWriter.java https://gitlab.com/zhengdingke/htest | Java | 302 lines
                    
15
                    
16import com.alibaba.fastjson.JSON;
                    
17import com.alibaba.fastjson.annotation.JSONCreator;
                    
58
                    
59    @JSONCreator
                    
60    public GangliaWriter(String host, Integer port, String addressingMode, Integer ttl, Boolean v31, String units, String slope, Integer tmax, Integer dmax,
                    
223    public String toString() {
                    
224        return JSON.toJSONString(this, true);
                    
225    }
                    
                
InboxService.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 236 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.message.UnreadMsg;
                    
48        String redisKey = RedisKey.getInboxKey(id);
                    
49        String json = JSON.toJSONString(msg);
                    
50
                    
76                if (newUnreadMsg == null) {
                    
77                    logger.error("The message is stale. Message in redis: {}. Message received: {}", JSON.toJSONString(oldUnreadMsg), JSON.toJSONString(msg));
                    
78                    return;
                    
80
                    
81                jedis.hset(redisKey, field, JSON.toJSONString(newUnreadMsg));
                    
82            }
                    
116                        msg.count = msg.msgId - msgId;
                    
117                        jedis.hset(redisKey, field, JSON.toJSONString(msg));
                    
118                    }
                    
                
JacksonObjectInput.java https://gitlab.com/sxyseo/dubbox | Java | 178 lines
                    
15 */
                    
16package com.alibaba.dubbo.common.serialize.support.json;
                    
17
                    
17
                    
18import com.alibaba.dubbo.common.json.Jackson;
                    
19import com.alibaba.dubbo.common.serialize.ObjectInput;
                    
19import com.alibaba.dubbo.common.serialize.ObjectInput;
                    
20import com.alibaba.dubbo.common.utils.ReflectUtils;
                    
21import com.fasterxml.jackson.databind.ObjectMapper;
                    
134//            if (json.startsWith("{")) {
                    
135//                return JSON.parse(json, Map.class);
                    
136//            } else {
                    
136//            } else {
                    
137//                json = "{\"value\":" + json + "}";
                    
138//
                    
                
RedisUtils.java https://gitlab.com/Xiaolei-Zhang/upload | Java | 389 lines
                    
10
                    
11import com.alibaba.fastjson.JSON;
                    
12import com.alibaba.fastjson.JSONObject;
                    
127        } else {
                    
128            JSONObject jsonObject = JSONObject.parseObject(object.toString());
                    
129            return JSON.toJavaObject(jsonObject, clazz);
                    
                
Type.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 331 lines
                    
1/***
                    
2 * ASM: a very small and fast Java bytecode manipulation framework
                    
3 * Copyright (c) 2000-2007 INRIA, France Telecom
                    
29 */
                    
30package com.alibaba.fastjson.asm;
                    
31
                    
                
PartialUpdateRestAction.java https://github.com/medcl/elasticsearch-partialupdate.git | Java | 408 lines
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONArray;
                    
5import com.alibaba.fastjson.JSONObject;
                    
65
                    
66        final JSONObject pendingChangeJsonObject=JSON.parseObject(sourceJson);
                    
67
                    
124                            logger.debug("pending:"+sourceJson);
                    
125                            JSONObject jsonObject = JSON.parseObject(source);
                    
126
                    
178                                        }else{
                    
179                                            jsonObject.put(next,pendingChangeJsonObject.get(next));
                    
180                                        }
                    
193
                    
194                            logger.debug("update json:"+jsonObject.toJSONString());
                    
195
                    
                
PullOldMsgHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 179 lines
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONObject;
                    
5import com.linbox.im.exceptions.IMConsumerException;
                    
52            logger.debug("start handling PullOldMsgRequest: {}", json);
                    
53            MessageWrapper wrapper = JSON.parseObject(json, MessageWrapper.class);
                    
54
                    
54
                    
55            PullOldMsgRequest request = JSON.parseObject(((JSONObject)wrapper.content).toJSONString(), PullOldMsgRequest.class);
                    
56            wrapper.content = request;
                    
69            if (StringUtils.isBlank(userId)) {
                    
70                logger.error("Can not find avaiable user id for PullOldMsgRequest {}", json);
                    
71                return;
                    
88                        if (StringUtils.isBlank(remoteId)) {
                    
89                            logger.error("Can not find corresponding remote id for PullOldMsgRequest: {}", json);
                    
90
                    
                
ProducerImpl.java https://gitlab.com/tanxinzheng/activemq-api | Java | 125 lines
                    
2
                    
3import com.alibaba.fastjson.JSONObject;
                    
4import com.udfex.ucs.amq.api.service.ProducerService;
                    
58                try {
                    
59                    ConsumeResult consumeResult = JSONObject.parseObject(message, ConsumeResult.class);
                    
60                    if (ConsumeResult.CONSUME_SUCCESS_CODE == consumeResult.getResultCode()) {
                    
                
UTF8Decoder.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 215 lines
                    
1package com.alibaba.fastjson.util;
                    
2
                    
                
MetricTimerTask.java https://gitlab.com/zhengdingke/gmonitor | Java | 107 lines
                    
9
                    
10import com.alibaba.fastjson.JSON;
                    
11import com.google.common.collect.Maps;
                    
90        // 以json的形式输入flume
                    
91        // log.info(JSON.toJSONString(info, true));
                    
92        client.sendDataToFlume(JSON.toJSONString(info));
                    
                
PushService.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 252 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.TypeReference;
                    
4import com.alibaba.fastjson.TypeReference;
                    
5import com.alibaba.fastjson.annotation.JSONField;
                    
6import com.alibaba.fastjson.parser.Feature;
                    
178
                    
179        @JSONField(
                    
180                serialize = false
                    
194        public UserMessage<T> getMessage(String json) {
                    
195            return (UserMessage) JSON.parseObject(json, new TypeReference() {
                    
196            }, new Feature[0]);
                    
222        public NSQMessageBase<T> getMessage(String json) {
                    
223            return (NSQMessageBase)JSON.parseObject(json, new TypeReference() {
                    
224            }, new Feature[0]);
                    
                
S.java git://github.com/greenlaw110/Rythm.git | Java | 1578 lines
                    
27
                    
28import com.alibaba.fastjson.JSON;
                    
29import org.apache.commons.lang3.StringEscapeUtils;
                    
440     * <ul>
                    
441     * <li>json: {@link #escapeJSON(Object)} </li>
                    
442     * <li>xml: {@link #escapeXML(Object)} </li>
                    
462        String se = escape.toString();
                    
463        if ("json".equalsIgnoreCase(se)) return escapeJson(o);
                    
464        if ("xml".equalsIgnoreCase(se)) return escapeXml(o);
                    
                
TemplateBase.java git://github.com/greenlaw110/Rythm.git | Java | 1597 lines
                    
27
                    
28import com.alibaba.fastjson.JSON;
                    
29import com.alibaba.fastjson.JSONArray;
                    
33import org.rythmengine.conf.RythmConfiguration;
                    
34import org.rythmengine.exception.FastRuntimeException;
                    
35import org.rythmengine.exception.RythmException;
                    
                
HttpRequest.java https://gitlab.com/GavinGJ/MATIRX | Java | 137 lines
                    
11
                    
12import com.alibaba.fastjson.JSONObject;
                    
13
                    
                
EnumDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 82 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
7
                    
8import com.alibaba.fastjson.JSONException;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
10import com.alibaba.fastjson.parser.JSONLexer;
                    
11import com.alibaba.fastjson.parser.JSONToken;
                    
40            Object value;
                    
41            final JSONLexer lexer = parser.getLexer();
                    
42            if (lexer.token() == JSONToken.LITERAL_INT) {
                    
47                if (e == null) {
                    
48                    throw new JSONException("parse enum " + enumClass.getName() + " error, value : " + value);
                    
49                }
                    
52                String strVal = lexer.stringVal();
                    
53                lexer.nextToken(JSONToken.COMMA);
                    
54
                    
                
SerializerFeature.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 131 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
                
JavaBeanSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 207 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
26
                    
27import com.alibaba.fastjson.JSONException;
                    
28import com.alibaba.fastjson.util.FieldInfo;
                    
28import com.alibaba.fastjson.util.FieldInfo;
                    
29import com.alibaba.fastjson.util.TypeUtils;
                    
30
                    
83
                    
84    protected boolean isWriteClassName(JSONSerializer serializer, Object obj, Type fieldType, Object fieldName) {
                    
85        return serializer.isWriteClassName(fieldType, obj);
                    
87
                    
88    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
89        SerializeWriter out = serializer.getWriter();
                    
                
FastjsonDataFormat.java https://gitlab.com/matticala/apache-camel | Java | 188 lines
                    
23
                    
24import com.alibaba.fastjson.JSON;
                    
25import com.alibaba.fastjson.serializer.SerializerFeature;
                    
25import com.alibaba.fastjson.serializer.SerializerFeature;
                    
26import com.alibaba.fastjson.support.config.FastJsonConfig;
                    
27import org.apache.camel.Exchange;
                    
34 * A <a href="http://camel.apache.org/data-format.html">data format</a> ({@link DataFormat})
                    
35 * using <a href="https://github.com/alibaba/fastjson">Fastjson</a> to marshal to and from JSON.
                    
36 */
                    
54
                    
55    public FastjsonDataFormat(FastJsonConfig config, Class<?> unmarshalType) {
                    
56        this.config = config;
                    
63
                    
64    public FastjsonDataFormat(FastJsonConfig config, Type unmarshalGenericType) {
                    
65        this.config = config;
                    
                
JavaBeanDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 343 lines
                    
11
                    
12import com.alibaba.fastjson.JSONException;
                    
13import com.alibaba.fastjson.JSONObject;
                    
13import com.alibaba.fastjson.JSONObject;
                    
14import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
15import com.alibaba.fastjson.parser.DefaultJSONParser.ResolveTask;
                    
16import com.alibaba.fastjson.parser.Feature;
                    
17import com.alibaba.fastjson.parser.JSONScanner;
                    
18import com.alibaba.fastjson.parser.JSONToken;
                    
18import com.alibaba.fastjson.parser.JSONToken;
                    
19import com.alibaba.fastjson.parser.ParseContext;
                    
20import com.alibaba.fastjson.parser.ParserConfig;
                    
20import com.alibaba.fastjson.parser.ParserConfig;
                    
21import com.alibaba.fastjson.util.DeserializeBeanInfo;
                    
22import com.alibaba.fastjson.util.FieldInfo;
                    
                
proguard-rules.pro https://gitlab.com/achmadalam.xirpl6/RamalanCuacaBukaan | Prolog | 125 lines
                    
91#FASTJSON
                    
92-dontwarn com.alibaba.fastjson.**
                    
93-keep class com.alibaba.fastjson.** { *; }
                    
                
FastJsonSerializationTest.java https://gitlab.com/zouxc/dubbo | Java | 266 lines
                    
48    
                    
49    @Ignore("FastJson bug: com.alibaba.fastjson.JSONException: create asm serilizer error, class char")
                    
50    @Test
                    
52    
                    
53    @Ignore("FastJson bug: com.alibaba.fastjson.JSONException: create asm serilizer error, class char")
                    
54    @Test
                    
96    
                    
97    @Ignore("com.alibaba.fastjson.JSONException: create asm deserializer error, java.sql.Time")
                    
98    @Test
                    
150    
                    
151    @Ignore("FastJson bug: com.alibaba.fastjson.JSONException: illegal identifier : 1")
                    
152    @Test
                    
249    
                    
250    @Ignore("FastJson bug: com.alibaba.fastjson.JSONException: illegal identifier : 1")
                    
251    @Test
                    
                
JsonUserType.java https://gitlab.com/0072016/es | Java | 144 lines
                    
7
                    
8import com.alibaba.fastjson.JSONObject;
                    
9import com.alibaba.fastjson.serializer.SerializerFeature;
                    
26 */
                    
27public class JsonUserType implements UserType, Serializable {
                    
28
                    
75
                    
76        return JSONObject.parse(valueStr);
                    
77    }
                    
88        } else {
                    
89            valueStr = JSONObject.toJSONString(value, SerializerFeature.WriteClassName);
                    
90        }
                    
112        if (o == null) return null;
                    
113        String jsonStr = JSONObject.toJSONString(o, SerializerFeature.WriteClassName);
                    
114        return JSONObject.parse(jsonStr);
                    
                
CharTypes.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 132 lines
                    
15 */
                    
16package com.alibaba.fastjson.parser;
                    
17
                    
                
ObjectUtil.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 152 lines
                    
17
                    
18import com.alibaba.fastjson.JSON;
                    
19import com.alibaba.fastjson.JSONArray;
                    
19import com.alibaba.fastjson.JSONArray;
                    
20import com.alibaba.fastjson.JSONObject;
                    
21
                    
79			}
                    
80			List<JSONObject> jsonObjectList = JSON.toJavaObject(
                    
81					jsonParamsValues.getJSONArray(paramName), List.class);
                    
103		}
                    
104		JSONObject jsonObject = jsonParamsValues.getJSONObject(paramName);
                    
105		return JSON.toJavaObject(jsonObject, clazz);
                    
108			String paramName, JSONObject jsonParamsValues,ServiceRequest request){
                    
109		JSONArray jsonArray = jsonParamsValues.containsKey(paramName) ? jsonParamsValues.getJSONArray(paramName) : null;
                    
110		String paramTypeName = clazz.getComponentType().getName();
                    
                
SendMsgHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 207 lines
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONObject;
                    
5import com.linbox.im.exceptions.IMConsumerException;
                    
102
                    
103                            logger.debug("Save SessionMessageDao into DB. Message: {}. Dao: {}", JSON.toJSONString(body), JSON.toJSONString(dao));
                    
104
                    
107                        } else {
                    
108                            logger.debug("Find existing SessionMessageDao for message: {}. Dao: {}", JSON.toJSONString(body), JSON.toJSONString(dao));
                    
109                        }
                    
135
                    
136                            logger.debug("Save GroupMessageDao into DB. Message: {}. Dao: {}", JSON.toJSONString(groupMsgBody), JSON.toJSONString(groupMsgDao));
                    
137
                    
140                        } else {
                    
141                            logger.debug("Find existing GroupMessageDao for message: {}. Dao: {}", JSON.toJSONString(groupMsgBody), JSON.toJSONString(groupMsgDao));
                    
142                        }
                    
                
MetricsJson.java https://gitlab.com/zhengdingke/gmonitor | Java | 162 lines
                    
11
                    
12import com.alibaba.fastjson.JSON;
                    
13import com.alibaba.fastjson.JSONArray;
                    
13import com.alibaba.fastjson.JSONArray;
                    
14import com.alibaba.fastjson.JSONObject;
                    
15import com.google.common.collect.Lists;
                    
118
                    
119        JSONArray servers = new JSONArray();
                    
120        servers.add(server);
                    
134        cinfo.getModule().stream().forEach(m -> {
                    
135            JSONObject moduleObj = createJsonObject(cinfo.getGmondConn(), serviceType, m);
                    
136            String jsonFileName = m.getName() + ".json";
                    
136            String jsonFileName = m.getName() + ".json";
                    
137            boolean over = StringFileTransUtil.string2File(JSON.toJSONString(moduleObj, true), new File(dir + "/test/" + jsonFileName));
                    
138            LOG.info("createFile:" + dir + ":" + jsonFileName + ":" + (over ? "success" : "false"));
                    
                
JSONWriter.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 151 lines
                    
1package com.alibaba.fastjson;
                    
2
                    
5
                    
6import com.alibaba.fastjson.serializer.JSONSerializer;
                    
7import com.alibaba.fastjson.serializer.SerializeWriter;
                    
8
                    
9public class JSONWriter {
                    
10
                    
13
                    
14    private JSONSerializer  serializer;
                    
15
                    
50
                    
51    public JSONWriter(Writer out){
                    
52        this.out = out;
                    
53        writer = new SerializeWriter();
                    
54        serializer = new JSONSerializer(writer);
                    
55    }
                    
                
FontDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 88 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
7
                    
8import com.alibaba.fastjson.JSONException;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
10import com.alibaba.fastjson.parser.JSONScanner;
                    
11import com.alibaba.fastjson.parser.JSONToken;
                    
18    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
                    
19        JSONScanner lexer = (JSONScanner) parser.getLexer();
                    
20        
                    
25
                    
26        if (lexer.token() != JSONToken.LBRACE && lexer.token() != JSONToken.COMMA) {
                    
27            throw new JSONException("syntax error");
                    
39            String key;
                    
40            if (lexer.token() == JSONToken.LITERAL_STRING) {
                    
41                key = lexer.stringVal();
                    
                
ThrowableDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 163 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
7
                    
8import com.alibaba.fastjson.JSONException;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
10import com.alibaba.fastjson.parser.Feature;
                    
11import com.alibaba.fastjson.parser.JSONScanner;
                    
12import com.alibaba.fastjson.parser.JSONToken;
                    
12import com.alibaba.fastjson.parser.JSONToken;
                    
13import com.alibaba.fastjson.parser.ParserConfig;
                    
14import com.alibaba.fastjson.util.TypeUtils;
                    
23    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
                    
24        JSONScanner lexer = (JSONScanner) parser.getLexer();
                    
25
                    
52            if (key == null) {
                    
53                if (lexer.token() == JSONToken.RBRACE) {
                    
54                    lexer.nextToken(JSONToken.COMMA);
                    
                
DeserializeBeanInfo.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 357 lines
                    
1package com.alibaba.fastjson.util;
                    
2
                    
12
                    
13import com.alibaba.fastjson.JSONException;
                    
14import com.alibaba.fastjson.annotation.JSONCreator;
                    
14import com.alibaba.fastjson.annotation.JSONCreator;
                    
15import com.alibaba.fastjson.annotation.JSONField;
                    
16
                    
185
                    
186            JSONField annotation = method.getAnnotation(JSONField.class);
                    
187
                    
343
                    
344            JSONCreator annotation = method.getAnnotation(JSONCreator.class);
                    
345            if (annotation != null) {
                    
346                if (factoryMethod != null) {
                    
347                    throw new JSONException("multi-json creator");
                    
348                }
                    
                
VelocityUtils.java https://gitlab.com/mrsunchangemyselfsun/ruoyi-vue | Java | 401 lines
                    
7import org.apache.velocity.VelocityContext;
                    
8import com.alibaba.fastjson.JSONObject;
                    
9import com.ruoyi.common.constant.GenConstants;
                    
77        String options = genTable.getOptions();
                    
78        JSONObject paramsObj = JSONObject.parseObject(options);
                    
79        String parentMenuId = getParentMenuId(paramsObj);
                    
85        String options = genTable.getOptions();
                    
86        JSONObject paramsObj = JSONObject.parseObject(options);
                    
87        String treeCode = getTreecode(paramsObj);
                    
253                importList.add("java.util.Date");
                    
254                importList.add("com.fasterxml.jackson.annotation.JsonFormat");
                    
255            }
                    
383        String options = genTable.getOptions();
                    
384        JSONObject paramsObj = JSONObject.parseObject(options);
                    
385        String treeName = paramsObj.getString(GenConstants.TREE_NAME);
                    
                
TimeDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 73 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
4
                    
5import com.alibaba.fastjson.JSONException;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONScanner;
                    
8import com.alibaba.fastjson.parser.JSONToken;
                    
15    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
                    
16        JSONScanner lexer = (JSONScanner) parser.getLexer();
                    
17        
                    
21            if (lexer.token() != JSONToken.LITERAL_STRING) {
                    
22                throw new JSONException("syntax error");
                    
23            }
                    
57            long longVal;
                    
58            JSONScanner dateLexer = new JSONScanner(strVal);
                    
59            if (dateLexer.scanISO8601DateIfMatch()) {
                    
                
MapDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 129 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
15
                    
16import com.alibaba.fastjson.JSONException;
                    
17import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
17import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
18import com.alibaba.fastjson.parser.JSONLexer;
                    
19import com.alibaba.fastjson.parser.JSONToken;
                    
19import com.alibaba.fastjson.parser.JSONToken;
                    
20import com.alibaba.fastjson.parser.ParseContext;
                    
21import com.alibaba.fastjson.util.AntiCollisionHashMap;
                    
28    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
                    
29        final JSONLexer lexer = parser.getLexer();
                    
30        if (lexer.token() == JSONToken.NULL) {
                    
30        if (lexer.token() == JSONToken.NULL) {
                    
31            lexer.nextToken(JSONToken.COMMA);
                    
32            return null;
                    
                
IMMessageDecoder.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 123 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.message.MessageWrapper;
                    
88
                    
89                        String json = aes.decrypt(buf);
                    
90
                    
90
                    
91                        Object message = JSON.parseObject(json, requestResponseType.getClazz());
                    
92
                    
93                        if (message == null) {
                    
94                            logger.error("Can not parse message content from json string. Message Type: {}. Message Content Size: {}. Message Content: {}.", requestResponseType.getName());
                    
95                        } else {
                    
                
ListSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 168 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
29
                    
30    public final void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType)
                    
31                                                                                                       throws IOException {
                    
                
MethodVisitor.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 183 lines
                    
1/***
                    
2 * ASM: a very small and fast Java bytecode manipulation framework
                    
3 * Copyright (c) 2000-2007 INRIA, France Telecom
                    
29 */
                    
30package com.alibaba.fastjson.asm;
                    
31
                    
59     * ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2,
                    
60     * DCONST_0, DCONST_1, IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE,
                    
61     * DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD,
                    
120     * @param owner the internal name of the method's owner class (see {@link Type#getInternalName() getInternalName})
                    
121     * or {@link com.alibaba.fastjson.asm.Opcodes#INVOKEDYNAMIC_OWNER}.
                    
122     * @param name the method's name.
                    
                
MapSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 180 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
33    @SuppressWarnings({ "rawtypes", "unchecked" })
                    
34    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
35        SerializeWriter out = serializer.getWriter();
                    
                
DispatchToSingleHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 161 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.exceptions.IMConsumerException;
                    
38    public void handle(ConsumerRecord<String, String> record) {
                    
39        String json = record.value();
                    
40
                    
41        try {
                    
42            SendDispatchMessage dispatchMsg = JSON.parseObject(json, SendDispatchMessage.class);
                    
43            if (dispatchMsg == null) {
                    
43            if (dispatchMsg == null) {
                    
44                throw new IMException("DispatchMessage could not be parsed correctly. Message: " + json);
                    
45            }
                    
59        } catch (Exception e) {
                    
60            throw new IMConsumerException(e, json);
                    
61        }
                    
                
Base64.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 198 lines
                    
1package com.alibaba.fastjson.util;
                    
2
                    
5/**
                    
6 * A very fast and memory efficient class to encode and decode to and from BASE64 in full accordance with RFC 2045.<br>
                    
7 * <br>
                    
8 * On Windows XP sp1 with 1.4.2_04 and later ;), this encoder and decoder is about 10 times faster on small arrays (10 -
                    
9 * 1000 bytes) and 2-3 times as fast on larger arrays (10000 - 1000000 bytes) compared to
                    
10 * <code>sun.misc.Encoder()/Decoder()</code>.<br>
                    
11 * <br>
                    
12 * On byte arrays the encoder is about 20% faster than Jakarta Commons Base64 Codec for encode and about 50% faster for
                    
13 * decoding large arrays. This implementation is about twice as fast on very small arrays (&lt 30 bytes). If
                    
13 * decoding large arrays. This implementation is about twice as fast on very small arrays (&lt 30 bytes). If
                    
14 * source/destination is a <code>String</code> this version is about three times as fast due to the fact that the
                    
15 * Commons Codec result has to be recoded to a <code>String</code> from <code>byte[]</code>, which is very expensive.<br>
                    
31 * <br>
                    
32 * There is also a "fast" version of all decode methods that works the same way as the normal ones, but har a few
                    
33 * demands on the decoded input. Normally though, these fast verions should be used if the source if the input is known
                    
                
Parsers.java https://gitlab.com/achmadalam.xirpl6/RamalanCuacaBukaan | Java | 129 lines
                    
6
                    
7import com.alibaba.fastjson.JSON;
                    
8
                    
99    //DESERIALISASI JSON DATA RAMALAN CUACA PER HARI
                    
100    public CuacaPerHari parseJSONCuacaHarian(String stringJson) {
                    
101
                    
104        try {
                    
105            cuacaPerHari = JSON.parseObject(stringJson, CuacaPerHari.class);
                    
106        } catch (Exception e) {
                    
114    //DESERIALISASI JSON DATA RAMALAN CUACA PER JAM
                    
115    public CuacaPerJams parseJSONCuacaPerJAM(String stringJSON) {
                    
116
                    
119        try {
                    
120            cuacaPerJams = JSON.parseObject(stringJSON, CuacaPerJams.class);
                    
121        } catch (Exception e) {
                    
                
JsonHttpMessageConverter.java https://gitlab.com/Fish-Potato/TTStreet-core | Java | 83 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.serializer.SerializerFeature;
                    
4import com.alibaba.fastjson.serializer.SerializerFeature;
                    
5import com.tts.util.JsonUtil;
                    
6import org.springframework.http.HttpInputMessage;
                    
24@Service
                    
25public class JsonHttpMessageConverter extends AbstractHttpMessageConverter<Object> {
                    
26    public static final Charset UTF8 = Charset.forName("UTF-8");
                    
30    public JsonHttpMessageConverter() {
                    
31        super(new MediaType[]{new MediaType("application", "json", UTF8), new MediaType("application", "*+json", UTF8)});
                    
32        this.charset = UTF8;
                    
77
                    
78        String text = JSON.toJSONString(obj, this.features);
                    
79        byte[] bytes = text.getBytes(this.charset);
                    
                
IOUtils.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 208 lines
                    
15 */
                    
16package com.alibaba.fastjson.util;
                    
17
                    
24
                    
25import com.alibaba.fastjson.JSONException;
                    
26
                    
84
                    
85        // Fall thru to fast mode for smaller numbers
                    
86        // assert(i2 <= 65536, i2);
                    
123
                    
124        // Fall thru to fast mode for smaller numbers
                    
125        // assert(i <= 65536, i);
                    
148
                    
149        // Fall thru to fast mode for smaller numbers
                    
150        // assert(i <= 65536, i);
                    
                
Label.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 248 lines
                    
1/***
                    
2 * ASM: a very small and fast Java bytecode manipulation framework
                    
3 * Copyright (c) 2000-2007 INRIA, France Telecom
                    
29 */
                    
30package com.alibaba.fastjson.asm;
                    
31
                    
49     * order to use it with the ASM tree package you must override the
                    
50     * {@link com.alibaba.fastjson.asm.tree.MethodNode#getLabelNode} method.
                    
51     */
                    
                
LongArraySerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 46 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
27
                    
28    public final void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
29        SerializeWriter out = serializer.getWriter();
                    
                
IntegerSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 44 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
27
                    
28    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
29        SerializeWriter out = serializer.getWriter();
                    
                
TestModelClass.java https://gitlab.com/zhengdingke/gmonitor | Java | 61 lines
                    
8
                    
9import com.alibaba.fastjson.JSON;
                    
10import com.zdingke.gmonitor.common.StringFileTransUtil;
                    
19    @Test
                    
20    public void generateComponentJsonFile() {
                    
21        MetricInfo minfo = new MetricInfo("memory", Arrays.asList(new String[]{"memory1","memory2"}),"memory");
                    
23        ComponentInfo cinfo = new ComponentInfo("storm", Arrays.asList(moinfo), "1.1.1.1:1111");
                    
24        StringFileTransUtil.string2File(JSON.toJSONString(cinfo, true), new File(TestModelClass.class.getResource("/").getFile().toString() + "storm.json"));
                    
25    }
                    
32        jinfo.setMetrics(Arrays.asList(minfo));
                    
33        StringFileTransUtil.string2File(JSON.toJSONString(jinfo, true), new File(TestModelClass.class.getResource("/").getFile().toString() + "jvm.json"));
                    
34    }
                    
37    public void combineJvm() {
                    
38        String jvm = StringFileTransUtil.file2String(new File(TestModelClass.class.getResource("/").getFile().toString() + "jvm.json"), "GBK");
                    
39        JVMInfo jinfo = JSON.parseObject(jvm, JVMInfo.class);
                    
                
ByteCreator.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 35 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.exceptions.IMException;
                    
32    public String toWrapperJson() {
                    
33        return JSON.toJSONString(toWrapper());
                    
34    }
                    
                
AtomicReferenceSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 35 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
29    @SuppressWarnings("rawtypes")
                    
30    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
31        AtomicReference val = (AtomicReference) object;
                    
                
BigIntegerDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 41 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
5
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
8import com.alibaba.fastjson.parser.JSONToken;
                    
9import com.alibaba.fastjson.util.TypeUtils;
                    
15    @SuppressWarnings("unchecked")
                    
16    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
                    
17        return (T) deserialze(parser);
                    
20    @SuppressWarnings("unchecked")
                    
21    public static <T> T deserialze(DefaultJSONParser parser) {
                    
22        final JSONLexer lexer = parser.getLexer();
                    
22        final JSONLexer lexer = parser.getLexer();
                    
23        if (lexer.token() == JSONToken.LITERAL_INT) {
                    
24            String val = lexer.numberString();
                    
                
RectangleDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 81 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
7
                    
8import com.alibaba.fastjson.JSONException;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
10import com.alibaba.fastjson.parser.JSONScanner;
                    
11import com.alibaba.fastjson.parser.JSONToken;
                    
18    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
                    
19        JSONScanner lexer = (JSONScanner) parser.getLexer();
                    
20        
                    
25
                    
26        if (lexer.token() != JSONToken.LBRACE && lexer.token() != JSONToken.COMMA) {
                    
27            throw new JSONException("syntax error");
                    
32        for (;;) {
                    
33            if (lexer.token() == JSONToken.RBRACE) {
                    
34                lexer.nextToken();
                    
                
Message.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 75 lines
                    
2
                    
3import com.alibaba.fastjson.annotation.JSONField;
                    
4import com.linbox.im.server.storage.entity.GroupMessageEntity;
                    
12    // 消息发送时的 rId
                    
13    @JSONField(name = "r_id")
                    
14    public long rId;
                    
16    // 发送方 id
                    
17    @JSONField(name = "from_user_id")
                    
18    public String fromUserId;
                    
20    // 目的方 id
                    
21    @JSONField(name = "to_user_id")
                    
22    public String toUserId;
                    
24    // 群组 id
                    
25    @JSONField(name = "group_id")
                    
26    public String groupId;
                    
                
HashMapToStringUserType.java https://gitlab.com/0072016/es | Java | 187 lines
                    
7
                    
8import com.alibaba.fastjson.JSONObject;
                    
9import com.alibaba.fastjson.serializer.SerializerFeature;
                    
99
                    
100        Map map = JSONObject.parseObject(valueStr);
                    
101        Map result = newMap();
                    
123        } else {
                    
124            valueStr = JSONObject.toJSONString(value, SerializerFeature.WriteClassName);
                    
125        }
                    
                
DispatchToGroupHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 67 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.exceptions.IMConsumerException;
                    
37    public void handle(ConsumerRecord<String, String> record) {
                    
38        String json = record.value();
                    
39
                    
40        try {
                    
41            final Message groupMessage = JSON.parseObject(json, Message.class);
                    
42
                    
43            if (groupMessage == null) {
                    
44                throw new IMException("Message could not be parsed correctly. Message: " + json);
                    
45            }
                    
63        } catch (Exception e) {
                    
64            throw new IMConsumerException(e, json);
                    
65        }
                    
                
User.java https://bitbucket.org/leafiwan/collegemailsystem.git | Java | 338 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() {
                    
                
CollectionDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 70 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
10
                    
11import com.alibaba.fastjson.JSONException;
                    
12import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
12import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
13import com.alibaba.fastjson.parser.JSONToken;
                    
14
                    
19    @SuppressWarnings({ "unchecked", "rawtypes" })
                    
20    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
                    
21        if (parser.getLexer().token() == JSONToken.NULL) {
                    
21        if (parser.getLexer().token() == JSONToken.NULL) {
                    
22            parser.getLexer().nextToken(JSONToken.COMMA);
                    
23            return null;
                    
40            } catch (Exception e) {
                    
41                throw new JSONException("create instane error, class " + rawClass.getName());
                    
42            }
                    
                
JSONArray.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 368 lines
                    
15 */
                    
16package com.alibaba.fastjson;
                    
17
                    
18import static com.alibaba.fastjson.util.TypeUtils.castToBigDecimal;
                    
19import static com.alibaba.fastjson.util.TypeUtils.castToBigInteger;
                    
20import static com.alibaba.fastjson.util.TypeUtils.castToBoolean;
                    
20import static com.alibaba.fastjson.util.TypeUtils.castToBoolean;
                    
21import static com.alibaba.fastjson.util.TypeUtils.castToByte;
                    
22import static com.alibaba.fastjson.util.TypeUtils.castToDate;
                    
23import static com.alibaba.fastjson.util.TypeUtils.castToDouble;
                    
24import static com.alibaba.fastjson.util.TypeUtils.castToFloat;
                    
25import static com.alibaba.fastjson.util.TypeUtils.castToInt;
                    
42
                    
43import com.alibaba.fastjson.util.TypeUtils;
                    
44
                    
                
SyncSystemUnreadHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 110 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONObject;
                    
44
                    
45            MessageWrapper wrapper = JSON.parseObject(json, MessageWrapper.class);
                    
46
                    
46
                    
47            SyncSystemUnreadRequest request = JSON.parseObject(((JSONObject)wrapper.content).toJSONString(), SyncSystemUnreadRequest.class);
                    
48            wrapper.content = request;
                    
50            if (request == null) {
                    
51                logger.error("SyncSystemUnreadCallback format is not correct. Json string: {}", json);
                    
52                return;
                    
66                newFriends.systemType = SystemMessageTypes.NewFriend.getValue();
                    
67                newFriends.content = JSON.toJSONString(newFriendsContent);
                    
68                messages.add(newFriends);
                    
                
PingHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 59 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONObject;
                    
31    public void handle(ConsumerRecord<String, String> record) {
                    
32        String json = record.value();
                    
33
                    
34        try {
                    
35            logger.debug("Start handling Ping: {}", json);
                    
36
                    
36
                    
37            MessageWrapper wrapper = JSON.parseObject(json, MessageWrapper.class);
                    
38
                    
38
                    
39            Ping ping = JSON.parseObject(((JSONObject)wrapper.content).toJSONString(), Ping.class);
                    
40            wrapper.content = ping;
                    
                
TTSRedisTemplate.java https://gitlab.com/Fish-Potato/TTStreet-core | Java | 113 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import org.apache.commons.collections.MapUtils;
                    
57            } else {
                    
58                cacheMap.put(key, JSON.toJSONString(value));
                    
59            }
                    
                
Feature.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 106 lines
                    
15 */
                    
16package com.alibaba.fastjson.parser;
                    
17
                    
64     */
                    
65    SortFeidFastMatch,
                    
66    
                    
                
JacksonTest.java https://gitlab.com/sxyseo/dubbox | Java | 177 lines
                    
1package com.alibaba.dubbo.common.json;
                    
2
                    
2
                    
3import com.alibaba.dubbo.common.serialize.support.json.FastJsonObjectOutput;
                    
4import com.alibaba.dubbo.common.serialize.support.json.JacksonObjectInput;
                    
4import com.alibaba.dubbo.common.serialize.support.json.JacksonObjectInput;
                    
5import com.alibaba.dubbo.common.serialize.support.json.JacksonObjectOutput;
                    
6import com.alibaba.dubbo.common.utils.CollectionUtils;
                    
6import com.alibaba.dubbo.common.utils.CollectionUtils;
                    
7import com.fasterxml.jackson.databind.ObjectMapper;
                    
8import org.junit.Test;
                    
                
IMMessageEncoder.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 45 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.message.MessageWrapper;
                    
32
                    
33            byte[] content = aes.encrypt(JSON.toJSONString(messageWrapper.content));
                    
34
                    
                
FastJsonObjectInput.java https://gitlab.com/zouxc/dubbo | Java | 138 lines
                    
15 */
                    
16package com.alibaba.dubbo.common.serialize.support.json;
                    
17
                    
27import com.alibaba.dubbo.common.utils.PojoUtils;
                    
28import com.alibaba.fastjson.JSON;
                    
29
                    
34 */
                    
35public class FastJsonObjectInput implements ObjectInput {
                    
36
                    
38
                    
39    public FastJsonObjectInput(InputStream in){
                    
40        this(new InputStreamReader(in));
                    
42
                    
43    public FastJsonObjectInput(Reader reader){
                    
44        this.reader = new BufferedReader(reader);
                    
                
LogUtils.java https://gitlab.com/0072016/es | Java | 150 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.google.common.collect.Lists;
                    
117        Map<String, String[]> params = request.getParameterMap();
                    
118        return JSON.toJSONString(params);
                    
119    }
                    
133        }
                    
134        return JSON.toJSONString(headers);
                    
135    }
                    
                
SyncUnreadHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 177 lines
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONObject;
                    
5import com.linbox.im.exceptions.IMConsumerException;
                    
45
                    
46            MessageWrapper wrapper = JSON.parseObject(json, MessageWrapper.class);
                    
47
                    
47
                    
48            SyncUnreadRequest request = JSON.parseObject(((JSONObject)wrapper.content).toJSONString(), SyncUnreadRequest.class);
                    
49            wrapper.content = request;
                    
51            if(request == null) {
                    
52                logger.error("SyncUnreadRequest format is not correct. Json string: {}", json);
                    
53                return;
                    
90                            if (StringUtils.isBlank(remoteId)) {
                    
91                                logger.error("Can not find remote id for SyncUnreadRequest {}", json);
                    
92                                throw new IMException("Non existing SyncUnreadRequest " + json);
                    
                
CompatibleFilter.java https://gitlab.com/sxyseo/dubbox | Java | 75 lines
                    
15 */
                    
16package com.alibaba.dubbo.rpc.filter;
                    
17
                    
21import com.alibaba.dubbo.common.Constants;
                    
22import com.alibaba.dubbo.common.logger.Logger;
                    
23import com.alibaba.dubbo.common.logger.LoggerFactory;
                    
23import com.alibaba.dubbo.common.logger.LoggerFactory;
                    
24import com.alibaba.dubbo.common.utils.CompatibleTypeUtils;
                    
25import com.alibaba.dubbo.common.utils.PojoUtils;
                    
25import com.alibaba.dubbo.common.utils.PojoUtils;
                    
26import com.alibaba.dubbo.rpc.Filter;
                    
27import com.alibaba.dubbo.rpc.Invocation;
                    
52                    if ("json".equals(serialization)
                    
53                            || "fastjson".equals(serialization)){
                    
54                        Type gtype = method.getGenericReturnType();
                    
                
SerializeConfig.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 175 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
42
                    
43import com.alibaba.fastjson.JSONException;
                    
44import com.alibaba.fastjson.annotation.JSONType;
                    
44import com.alibaba.fastjson.annotation.JSONType;
                    
45import com.alibaba.fastjson.util.ASMUtils;
                    
46import com.alibaba.fastjson.util.IdentityHashMap;
                    
76        {
                    
77            JSONType annotation = clazz.getAnnotation(JSONType.class);
                    
78            if (annotation != null && annotation.asm() == false) {
                    
89            } catch (Throwable e) {
                    
90                throw new JSONException("create asm serializer error, class " + clazz, e);
                    
91            }
                    
                
IntegerFieldDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 57 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
5
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
8import com.alibaba.fastjson.parser.JSONToken;
                    
9import com.alibaba.fastjson.parser.ParserConfig;
                    
10import com.alibaba.fastjson.util.FieldInfo;
                    
11import com.alibaba.fastjson.util.TypeUtils;
                    
12
                    
19    @Override
                    
20    public void parseField(DefaultJSONParser parser, Object object, Type objectType, Map<String, Object> fieldValues) {
                    
21        Integer value;
                    
22
                    
23        final JSONLexer lexer = parser.getLexer();
                    
24        if (lexer.token() == JSONToken.LITERAL_INT) {
                    
                
AuthenticationEntryPointImpl.java https://gitlab.com/mrsunchangemyselfsun/ruoyi-vue | Java | 34 lines
                    
9import org.springframework.stereotype.Component;
                    
10import com.alibaba.fastjson.JSON;
                    
11import com.ruoyi.common.constant.HttpStatus;
                    
31        String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
                    
32        ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));
                    
33    }
                    
                
DefaultExtJSONParser.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 42 lines
                    
15 */
                    
16package com.alibaba.fastjson.parser;
                    
17
                    
22@Deprecated
                    
23public class DefaultExtJSONParser extends DefaultJSONParser {
                    
24
                    
24
                    
25    public DefaultExtJSONParser(String input){
                    
26        this(input, ParserConfig.getGlobalInstance());
                    
28
                    
29    public DefaultExtJSONParser(String input, ParserConfig mapping){
                    
30        super(input, mapping);
                    
32
                    
33    public DefaultExtJSONParser(String input, ParserConfig mapping, int features){
                    
34        super(input, mapping, features);
                    
                
IMService.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 137 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.google.common.base.Strings;
                    
113
                    
114        String json = JSON.toJSONString(wrapper);
                    
115
                    
115
                    
116        kafkaProducer.send(new ProducerRecord(MessageTopic.TOPIC_SEND_MSG, json));
                    
117    }
                    
134
                    
135        outboxService.put(targetUserId, systemMessage.toWrapperJson());
                    
136    }
                    
                
SameUrlDataInterceptor.java https://gitlab.com/mrsunchangemyselfsun/ruoyi-vue | Java | 110 lines
                    
9import org.springframework.stereotype.Component;
                    
10import com.alibaba.fastjson.JSONObject;
                    
11import com.ruoyi.common.annotation.RepeatSubmit;
                    
52        {
                    
53            nowParams = JSONObject.toJSONString(request.getParameterMap());
                    
54        }
                    
                
ConsumerImpl.java https://gitlab.com/tanxinzheng/activemq-api | Java | 77 lines
                    
2
                    
3import com.alibaba.fastjson.JSONObject;
                    
4import org.apache.activemq.command.ActiveMQQueue;
                    
56                    consumeResult.setRequestId(requestId);
                    
57                    TextMessage responseMessage = session.createTextMessage(JSONObject.toJSONString(consumeResult));
                    
58                    responseMessage.setStringProperty(BaseMessage.MESSAGE_ID, messageId);
                    
                
SyncUnreadRequest.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 39 lines
                    
2
                    
3import com.alibaba.fastjson.annotation.JSONField;
                    
4
                    
9    // request id
                    
10    @JSONField(name="r_id")
                    
11    public long rId;
                    
13    // user chat id
                    
14    @JSONField(name="user_id")
                    
15    public String userId;
                    
18    // 非必填项,填写则指定拉取一组对话的未读数信息。不填则拉取所有未读数信息
                    
19    @JSONField(name = "remote_id")
                    
20    public String remoteId;
                    
21
                    
22    @JSONField(name = "group_id")
                    
23    public String groupId;
                    
                
IdentityHashMap.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 96 lines
                    
15 */
                    
16package com.alibaba.fastjson.util;
                    
17
                    
                
IMMessageHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 138 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.message.*;
                    
60
                    
61        String json = JSON.toJSONString(wrapper);
                    
62
                    
71
                    
72                kafkaProducer.send(new ProducerRecord<String, String>(MessageTopic.TOPIC_SYNC_UNREAD, json));
                    
73                break;
                    
91
                    
92                kafkaProducer.send(new ProducerRecord<String, String>(MessageTopic.TOPIC_PULL_OLD_MEG, json));
                    
93                break;
                    
125            default:
                    
126                logger.error("{} is not handled right now. Message content: {}", type.getName(), JSON.toJSONString(msg));
                    
127        }
                    
                
JsonUtil.java https://gitlab.com/Fish-Potato/TTStreet-core | Java | 80 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONObject;
                    
4import com.alibaba.fastjson.JSONObject;
                    
5import com.alibaba.fastjson.parser.Feature;
                    
6import com.alibaba.fastjson.parser.ParserConfig;
                    
6import com.alibaba.fastjson.parser.ParserConfig;
                    
7import com.alibaba.fastjson.parser.deserializer.ParseProcess;
                    
8
                    
23        }
                    
24        return JSON.toJSONString(o);
                    
25    }
                    
72        T t = null;
                    
73        JSONObject jsonObject =(JSONObject) JSON.parse(param);
                    
74        return (T)jsonObject.get(jsonObject.keySet().iterator().next());
                    
                
TestAOP.java https://gitlab.com/GavinGJ/MATIRX | Java | 205 lines
                    
22
                    
23import com.alibaba.fastjson.JSON;
                    
24import com.alibaba.fastjson.JSONObject;
                    
72
                    
73            String json = JSONObject.toJSONString(params);
                    
74            String version = null;
                    
84
                    
85            List<ParamModel> jsons = JSON.parseArray(json, ParamModel.class);
                    
86            if (jsons.get(0).getUserId() != null) {
                    
175    public void send2Redmine(String desc) throws ClientProtocolException, IOException {
                    
176        JSONObject jo = new JSONObject();
                    
177        issue issue = new issue();
                    
196    public void getMapByJson(String json) {
                    
197        Map mapTypes = JSON.parseObject(json);
                    
198        // 最外层解析  
                    
                
ASMJavaBeanDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 100 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
5
                    
6import com.alibaba.fastjson.JSONException;
                    
7import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
8import com.alibaba.fastjson.parser.Feature;
                    
9import com.alibaba.fastjson.parser.JSONScanner;
                    
10import com.alibaba.fastjson.parser.ParserConfig;
                    
10import com.alibaba.fastjson.parser.ParserConfig;
                    
11import com.alibaba.fastjson.util.FieldInfo;
                    
12
                    
29    @SuppressWarnings("unchecked")
                    
30    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
                    
31        return (T) serializer.deserialze(parser, type, fieldName);
                    
54    public boolean parseField(DefaultJSONParser parser, String key, Object object, Type objectType, Map<String, Object> fieldValues) {
                    
55        JSONScanner lexer = (JSONScanner) parser.getLexer(); // xxx
                    
56
                    
                
JsonFilePipeline.java https://gitlab.com/taichu/webmagic | Java | 47 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import org.apache.commons.codec.digest.DigestUtils;
                    
15/**
                    
16 * Store results to files in JSON format.<br>
                    
17 *
                    
20 */
                    
21public class JsonFilePipeline extends FilePersistentBase implements Pipeline {
                    
22
                    
25    /**
                    
26     * new JsonFilePageModelPipeline with default path "/data/webmagic/"
                    
27     */
                    
40            PrintWriter printWriter = new PrintWriter(new FileWriter(getFile(path + DigestUtils.md5Hex(resultItems.getRequest().getUrl()) + ".json")));
                    
41            printWriter.write(JSON.toJSONString(resultItems.getAll()));
                    
42            printWriter.close();
                    
                
JobProcessLog.java https://gitlab.com/zhengdingke/htest | Java | 59 lines
                    
4
                    
5import com.alibaba.fastjson.JSON;
                    
6
                    
45    public String toString() {
                    
46        return JSON.toJSONString(this);
                    
47    }
                    
                
LoopQuery.scala https://gitlab.com/coinmachine/ares | Scala | 198 lines
                    
2
                    
3import com.alibaba.fastjson.{JSON, JSONObject}
                    
4import com.coinmachine.ares.Logging
                    
15      try {
                    
16        val pos = JSON.parse(user.futurePostV1.future_position(symbol, contractType)).asInstanceOf[JSONObject]
                    
17        if (Option(pos).nonEmpty) {
                    
57      try {
                    
58        val orders = JSON.parse(user.stockPostV1.order_info(symbol, orderId)).asInstanceOf[JSONObject].getJSONArray("orders")
                    
59        Option(orders) match {
                    
81      try {
                    
82        val orders = JSON.parse(user.futurePostV1.future_orders_info(symbol, contractType, orderId)).asInstanceOf[JSONObject].getJSONArray("orders")
                    
83        Option(orders) match {
                    
159      try {
                    
160        val ticker = JSON.parse(user.futureGetV1.future_ticker(symbol, contractType)).asInstanceOf[JSONObject]
                    
161        if (ticker.containsKey("ticker")) {
                    
                
ClassDerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 40 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
4
                    
5import com.alibaba.fastjson.JSONException;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
8import com.alibaba.fastjson.parser.JSONToken;
                    
8import com.alibaba.fastjson.parser.JSONToken;
                    
9import com.alibaba.fastjson.util.TypeUtils;
                    
10
                    
18    @SuppressWarnings("unchecked")
                    
19    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
                    
20        JSONLexer lexer = parser.getLexer();
                    
21        
                    
22        if (lexer.token() == JSONToken.NULL) {
                    
23            lexer.nextToken();
                    
                
LogAspect.java https://gitlab.com/mrsunchangemyselfsun/ruoyi-vue | Java | 218 lines
                    
16import org.springframework.web.servlet.HandlerMapping;
                    
17import com.alibaba.fastjson.JSON;
                    
18import com.ruoyi.common.annotation.Log;
                    
45     */
                    
46    @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
                    
47    public void doAfterReturning(JoinPoint joinPoint, Log controllerLog, Object jsonResult)
                    
48    {
                    
49        handleLog(joinPoint, controllerLog, null, jsonResult);
                    
50    }
                    
132        {
                    
133            operLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
                    
134        }
                    
171                    {
                    
172                        Object jsonObj = JSON.toJSON(o);
                    
173                        params += jsonObj.toString() + " ";
                    
                
ReadAckHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 133 lines
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONObject;
                    
5import com.linbox.im.exceptions.IMConsumerException;
                    
40        try {
                    
41            logger.debug("Start handling ReadAckRequest: {}", json);
                    
42
                    
42
                    
43            MessageWrapper wrapper = JSON.parseObject(json, MessageWrapper.class);
                    
44
                    
44
                    
45            ReadAckRequest request = JSON.parseObject(((JSONObject)wrapper.content).toJSONString(), ReadAckRequest.class);
                    
46            wrapper.content = request;
                    
66                        if (StringUtils.isBlank(remoteId)) {
                    
67                            logger.error("Can not find remote id for ReadAckRequest {}", json);
                    
68
                    
                
StringSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 46 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
27
                    
28    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
29        write(serializer, (String) object);
                    
31
                    
32    public void write(JSONSerializer serializer, String value) {
                    
33        SerializeWriter out = serializer.getWriter();
                    
                
ObjectFieldSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 120 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
19
                    
20import com.alibaba.fastjson.annotation.JSONField;
                    
21import com.alibaba.fastjson.util.FieldInfo;
                    
40
                    
41        JSONField annotation = fieldInfo.getAnnotation(JSONField.class);
                    
42
                    
66    @Override
                    
67    public void writeProperty(JSONSerializer serializer, Object propertyValue) throws Exception {
                    
68        writePrefix(serializer);
                    
                
LocalServiceInvoker.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 120 lines
                    
22
                    
23import com.alibaba.fastjson.JSON;
                    
24import com.alibaba.fastjson.JSONArray;
                    
24import com.alibaba.fastjson.JSONArray;
                    
25import com.alibaba.fastjson.JSONObject;
                    
26
                    
79				.getParameterNames(methodToCall);
                    
80		JSONObject jsonParamsValues = serviceRequest.getParams();
                    
81		Class<?>[] parameterTypes = methodToCall.getParameterTypes();
                    
83		Object[] paramValues = new Object[parameterTypes.length];
                    
84		logger.debug("jsonParamValues:" + jsonParamsValues);
                    
85		for (int i = 0; i < parameterTypes.length; i++) {
                    
88			Type type = types[i];
                    
89			paramValues[i] = ObjectUtil.initValue(clazz, type, paramName, jsonParamsValues, serviceRequest);
                    
90		}
                    
                
ArrayListTypeFieldDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 131 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
9
                    
10import com.alibaba.fastjson.JSONException;
                    
11import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
12import com.alibaba.fastjson.parser.Feature;
                    
13import com.alibaba.fastjson.parser.JSONLexer;
                    
14import com.alibaba.fastjson.parser.JSONToken;
                    
14import com.alibaba.fastjson.parser.JSONToken;
                    
15import com.alibaba.fastjson.parser.ParseContext;
                    
16import com.alibaba.fastjson.parser.ParserConfig;
                    
16import com.alibaba.fastjson.parser.ParserConfig;
                    
17import com.alibaba.fastjson.util.FieldInfo;
                    
18
                    
99            deserializer = parser.getConfig().getDeserializer(itemType);
                    
100            itemFastMatchToken = deserializer.getFastMatchToken();
                    
101        }
                    
                
StrategyUtil.scala https://gitlab.com/coinmachine/ares | Scala | 88 lines
                    
2
                    
3import com.alibaba.fastjson.{JSON, JSONObject}
                    
4import com.coinmachine.ares.Logging
                    
12  def config(): (UserInfo, String, Float, Float, Float) = {
                    
13    val conf = new JSONObject()
                    
14
                    
34
                    
35    val userInfoData = JSON.parse(userInfo.futurePostV1.future_userinfo()).asInstanceOf[JSONObject]
                    
36    Option(userInfoData) match {
                    
                
JsonFilePageModelPipeline.java https://gitlab.com/taichu/webmagic | Java | 56 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import org.apache.commons.codec.digest.DigestUtils;
                    
16/**
                    
17 * Store results objects (page models) to files in JSON format.<br>
                    
18 * Use model.getKey() as file name if the model implements HasKey.<br>
                    
23 */
                    
24public class JsonFilePageModelPipeline extends FilePersistentBase implements PageModelPipeline {
                    
25
                    
28    /**
                    
29     * new JsonFilePageModelPipeline with default path "/data/webmagic/"
                    
30     */
                    
49            PrintWriter printWriter = new PrintWriter(new FileWriter(getFile(filename)));
                    
50            printWriter.write(JSON.toJSONString(o));
                    
51            printWriter.close();
                    
                
FieldSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 97 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
21
                    
22import com.alibaba.fastjson.annotation.JSONField;
                    
23import com.alibaba.fastjson.util.FieldInfo;
                    
46
                    
47        JSONField annotation = fieldInfo.getAnnotation(JSONField.class);
                    
48        if (annotation != null) {
                    
72
                    
73    public void writePrefix(JSONSerializer serializer) throws IOException {
                    
74        SerializeWriter out = serializer.getWriter();
                    
94
                    
95    public abstract void writeProperty(JSONSerializer serializer, Object propertyValue) throws Exception;
                    
96
                    
                
TestJson.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 56 lines
                    
8
                    
9import com.alibaba.fastjson.JSON;
                    
10import com.alibaba.fastjson.JSONObject;
                    
11
                    
12public class TestJson {
                    
13
                    
18//		list.add("一切");
                    
19//		System.out.println(JSON.toJSONString(list));
                    
20		List<CustomBean> beans = new ArrayList<CustomBean>();
                    
33		//}
                    
34		//System.out.println(JSON.toJSONString(beans, true));
                    
35		String strs = JSON.toJSONString(beans);
                    
36		System.out.println(strs);
                    
37//		//List list = JSON.parseArray(strs, List.class);
                    
38//		//System.out.println(list);
                    
                
InetSocketAddressDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 64 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
6
                    
7import com.alibaba.fastjson.JSONException;
                    
8import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
8import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
9import com.alibaba.fastjson.parser.JSONLexer;
                    
10import com.alibaba.fastjson.parser.JSONToken;
                    
17    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
                    
18        JSONLexer lexer = parser.getLexer();
                    
19
                    
19
                    
20        if (lexer.token() == JSONToken.NULL) {
                    
21            lexer.nextToken();
                    
24
                    
25        parser.accept(JSONToken.LBRACE);
                    
26
                    
                
ServiceRequest.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 206 lines
                    
11
                    
12import com.alibaba.fastjson.JSONObject;
                    
13
                    
54	/** 头信息. */
                    
55	private JSONObject headers;
                    
56	
                    
57	/** 应用参数. */
                    
58	private JSONObject params;
                    
59	
                    
71	public ServiceRequest(HttpServletRequest servletRequest, String fullServiceName, String service,
                    
72			String method, JSONObject headers, JSONObject params,
                    
73			boolean isMultiPart,Map<String,MultipartFile> fileMap) {
                    
112	 */
                    
113	public JSONObject getHeaders() {
                    
114		if(headers==null){
                    
                
NumberFieldSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 49 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
17
                    
18import com.alibaba.fastjson.util.FieldInfo;
                    
19
                    
30    @Override
                    
31    public void writeProperty(JSONSerializer serializer, Object propertyValue) throws Exception {
                    
32        SerializeWriter out = serializer.getWriter();
                    
                
BigDecimalDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 47 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
5
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
8import com.alibaba.fastjson.parser.JSONToken;
                    
9import com.alibaba.fastjson.util.TypeUtils;
                    
15    @SuppressWarnings("unchecked")
                    
16    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
                    
17        return (T) deserialze(parser);
                    
20    @SuppressWarnings("unchecked")
                    
21    public static <T> T deserialze(DefaultJSONParser parser) {
                    
22        final JSONLexer lexer = parser.getLexer();
                    
22        final JSONLexer lexer = parser.getLexer();
                    
23        if (lexer.token() == JSONToken.LITERAL_INT) {
                    
24            long val = lexer.longValue();
                    
                
CharArrayDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 47 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
4
                    
5import com.alibaba.fastjson.JSON;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONLexer;
                    
8import com.alibaba.fastjson.parser.JSONToken;
                    
19    @SuppressWarnings("unchecked")
                    
20    public static <T> T deserialze(DefaultJSONParser parser) {
                    
21        final JSONLexer lexer = parser.getLexer();
                    
21        final JSONLexer lexer = parser.getLexer();
                    
22        if (lexer.token() == JSONToken.LITERAL_STRING) {
                    
23            String val = lexer.stringVal();
                    
39
                    
40        return (T) JSON.toJSONString(value).toCharArray();
                    
41    }
                    
                
SplashPresenter.java https://gitlab.com/gzsll/TLint | Java | 89 lines
                    
4import android.support.annotation.NonNull;
                    
5import com.alibaba.fastjson.JSON;
                    
6import com.gzsll.hupu.Constants;
                    
52              String result = mOkHttpHelper.getStringFromServer(Constants.UPDATE_URL);
                    
53              return JSON.parseObject(result, UpdateInfo.class);
                    
54            } catch (Exception e) {
                    
                
FastJson2JsonRedisSerializer.java https://gitlab.com/mrsunchangemyselfsun/ruoyi-vue | Java | 71 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.serializer.SerializerFeature;
                    
9import org.springframework.data.redis.serializer.SerializationException;
                    
10import com.alibaba.fastjson.parser.ParserConfig;
                    
11import org.springframework.util.Assert;
                    
18 */
                    
19public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
                    
20{
                    
32
                    
33    public FastJson2JsonRedisSerializer(Class<T> clazz)
                    
34    {
                    
45        }
                    
46        return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
                    
47    }
                    
                
ConsumerClient.java https://gitlab.com/tanxinzheng/activemq-api | Java | 54 lines
                    
2
                    
3import com.alibaba.fastjson.JSONObject;
                    
4import com.udfex.ucs.amq.api.*;
                    
25            public MockData fromMessage(DataMessage dataMessage) {
                    
26                return JSONObject.parseObject(dataMessage.getMessageBody(), MockData.class);
                    
27            }
                    
30            public void handler(MockData message) {
                    
31                System.out.println("消费,GUEST.PID_UDFEX_PRODUCER_TEST_00001:" + JSONObject.toJSONString(message));
                    
32                if(message.getAge() %2 ==0){
                    
43            public MockData2 fromMessage(DataMessage dataMessage) {
                    
44                return JSONObject.parseObject(dataMessage.getMessageBody(), MockData2.class);
                    
45            }
                    
                
EnumerationSeriliazer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 75 lines
                    
1package com.alibaba.fastjson.serializer;
                    
2
                    
11    
                    
12    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
13        SerializeWriter out = serializer.getWriter();
                    
                
JSONToken.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 117 lines
                    
15 */
                    
16package com.alibaba.fastjson.parser;
                    
17
                    
20 */
                    
21public class JSONToken {
                    
22
                    
                
FutureWaveCutter.scala https://gitlab.com/coinmachine/ares | Scala | 199 lines
                    
2
                    
3import com.alibaba.fastjson.{JSONObject, JSON}
                    
4import com.coinmachine.ares.Logging
                    
29        val userInfo = LoopQuery.futureUserInfo(user);
                    
30        val marketUserInfo = userInfo.getJSONObject(coinType)
                    
31        val accountRights = marketUserInfo.getFloat("account_rights")
                    
                
MetricJsonCreateUtil.java https://gitlab.com/zhengdingke/gmonitor | Java | 116 lines
                    
14import com.alibaba.fastjson.JSON;
                    
15import com.alibaba.fastjson.JSONObject;
                    
16import com.google.common.collect.Lists;
                    
72            String serviceType = info.getName().replace("-info.json", "");
                    
73            MetricsJson metricJson = getMetricsJsonByServiceType(serviceType, dirpath);
                    
74            ComponentInfo cinfo = null;
                    
78                cinfo.getModule().stream().forEach(m -> {
                    
79                    jsonObj.add(metricJson.createJsonObject(gmondConn, serviceType, m));
                    
80                });
                    
90        List<JSONObject> jsonObj = Lists.newArrayList();
                    
91        MetricsJson metricJson = getMetricsJsonByServiceType(serviceType, dirpath);
                    
92        ComponentInfo cinfo = null;
                    
96            cinfo.getModule().stream().forEach(m -> {
                    
97                jsonObj.add(metricJson.createJsonObject(gmondConn, serviceType, m));
                    
98            });
                    
                
GangliaSink.java https://gitlab.com/zhengdingke/htest | Java | 58 lines
                    
12
                    
13import com.alibaba.fastjson.JSON;
                    
14import com.zdingke.flume.ganglia.metric.GangliaWriter;
                    
45    private void sendDataToGanglia(String data) {
                    
46        MetricInfo info = JSON.parseObject(data,MetricInfo.class);
                    
47        String []strs= info.getGmetadInfo().split(":");
                    
                
ServerConfig.java https://gitlab.com/qt-prometheus/qt-prometheus.git | Java | 300 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.alibaba.fastjson.JSONArray;
                    
4import com.alibaba.fastjson.JSONArray;
                    
5import com.alibaba.fastjson.JSONObject;
                    
6import java.io.InputStream;
                    
137    {
                    
138      paramString = (JSONObject)JSON.parse(paramString);
                    
139      Object localObject1 = paramString.getJSONArray("defaultroots");
                    
152        }
                    
153        ((List)localObject2).add(((JSONArray)localObject1).getJSONObject(i).getString("root").trim());
                    
154        i += 1;
                    
155      }
                    
156      Object localObject3 = ((JSONArray)localObject2).getJSONObject(i);
                    
157      String str1 = ((JSONObject)localObject3).getString("type");
                    
                
InetSocketAddressSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 33 lines
                    
1package com.alibaba.fastjson.serializer;
                    
2
                    
11
                    
12    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
13        if (object == null) {
                    
                
LocaleDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 36 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
5
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONToken;
                    
12    @SuppressWarnings("unchecked")
                    
13    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
                    
14        String text = (String) parser.parse();
                    
32
                    
33    public int getFastMatchToken() {
                    
34        return JSONToken.LITERAL_STRING;
                    
                
JSONException.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 36 lines
                    
15 */
                    
16package com.alibaba.fastjson;
                    
17
                    
20 */
                    
21public class JSONException extends RuntimeException {
                    
22
                    
24
                    
25    public JSONException(){
                    
26        super();
                    
28
                    
29    public JSONException(String message){
                    
30        super(message);
                    
32
                    
33    public JSONException(String message, Throwable cause){
                    
34        super(message, cause);
                    
                
SendMsgResponse.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 39 lines
                    
2
                    
3import com.alibaba.fastjson.annotation.JSONField;
                    
4
                    
8public class SendMsgResponse extends ByteCreator {
                    
9    @JSONField(name = "r_id")
                    
10    public long rId;
                    
11
                    
12    @JSONField(name = "msg_r_id")
                    
13    public long msgRId;
                    
14
                    
15    @JSONField(name = "user_id")
                    
16    public String userId;
                    
17
                    
18    @JSONField(name = "remote_id")
                    
19    public String remoteId;
                    
                
TimestampDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 56 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
8
                    
9import com.alibaba.fastjson.JSONException;
                    
10import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
10import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
11import com.alibaba.fastjson.parser.JSONToken;
                    
12
                    
17    @SuppressWarnings("unchecked")
                    
18    protected <T> T cast(DefaultJSONParser parser, Type clazz, Object fieldName, Object val) {
                    
19
                    
49
                    
50        throw new JSONException("parse error");
                    
51    }
                    
52
                    
53    public int getFastMatchToken() {
                    
54        return JSONToken.LITERAL_INT;
                    
                
DynamicSubject.java https://gitlab.com/JasonZheng150214/Jasyl | Java | 45 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4
                    
26        Object result = method.invoke(object, args);
                    
27        System.out.println(JSON.toJSON(result));
                    
28
                    
                
DateSerializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 124 lines
                    
15 */
                    
16package com.alibaba.fastjson.serializer;
                    
17
                    
23
                    
24import com.alibaba.fastjson.util.IOUtils;
                    
25
                    
32
                    
33    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
                    
34        SerializeWriter out = serializer.getWriter();
                    
                
ProducerClient.java https://gitlab.com/tanxinzheng/activemq-api | Java | 48 lines
                    
2
                    
3import com.alibaba.fastjson.JSONObject;
                    
4import com.udfex.ucs.amq.api.*;
                    
30        dataMessage.setTopic("GUEST.PID_UDFEX_PRODUCER_TEST_00002");
                    
31        dataMessage.setMessageBody(JSONObject.toJSONString(data));
                    
32        producer.send(dataMessage);
                    
45        data2.setName("测试队列2");
                    
46        //producer2.send(JSONObject.toJSONString(data2));
                    
47    }
                    
                
AbstractDateDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 99 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
4
                    
5import com.alibaba.fastjson.JSONException;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.Feature;
                    
8import com.alibaba.fastjson.parser.JSONScanner;
                    
9import com.alibaba.fastjson.parser.JSONToken;
                    
9import com.alibaba.fastjson.parser.JSONToken;
                    
10import com.alibaba.fastjson.util.TypeUtils;
                    
11
                    
15    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
                    
16        JSONScanner lexer = (JSONScanner) parser.getLexer();
                    
17
                    
27            if (lexer.isEnabled(Feature.AllowISO8601DateFormat)) {
                    
28                JSONScanner iso8601Lexer = new JSONScanner(strVal);
                    
29                if (iso8601Lexer.scanISO8601DateIfMatch()) {
                    
                
Restful.java https://gitlab.com/sxyseo/dubbox | Java | 92 lines
                    
7 */
                    
8package com.alibaba.dubbo.governance.web.home.module.screen;
                    
9
                    
17
                    
18import com.alibaba.dubbo.common.URL;
                    
19import com.alibaba.dubbo.governance.web.util.WebConstants;
                    
20import com.alibaba.dubbo.registry.common.domain.User;
                    
21import com.alibaba.fastjson.JSON;
                    
22
                    
57        context.put("operatorAddress", operatorAddress);
                    
58        String jsonResult = null;
                    
59        try {
                    
79        try {
                    
80            jsonResult = JSON.toJSONString(result);
                    
81            os.print(jsonResult);
                    
                
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, "查看数据");
                    
                
UpdateAgent.java https://gitlab.com/gzsll/TLint | Java | 175 lines
                    
13import com.afollestad.materialdialogs.MaterialDialog;
                    
14import com.alibaba.fastjson.JSON;
                    
15import com.gzsll.hupu.BuildConfig;
                    
68          String result = mOkHttpHelper.getStringFromServer(Constants.UPDATE_URL);
                    
69          return JSON.parseObject(result, UpdateInfo.class);
                    
70        } catch (Exception e) {
                    
                
UserHelper.java https://github.com/dawnsait/holywar.git | Java | 44 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.fasheng.service.dto.PartnerUserDTO;
                    
11    public static PartnerUserLoginRequest getPartnerUserLoginRequest(String requestInfo) {
                    
12        return JSON.parseObject(requestInfo, PartnerUserLoginRequest.class);
                    
13    }
                    
                
StackTraceElementDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 122 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
4
                    
5import com.alibaba.fastjson.JSONException;
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.Feature;
                    
8import com.alibaba.fastjson.parser.JSONLexer;
                    
9import com.alibaba.fastjson.parser.JSONToken;
                    
22
                    
23        if (lexer.token() != JSONToken.LBRACE && lexer.token() != JSONToken.COMMA) {
                    
24            throw new JSONException("syntax error: " + JSONToken.name(lexer.token()));
                    
67                    fileName = null;
                    
68                } else if (lexer.token() == JSONToken.LITERAL_STRING) {
                    
69                    fileName = lexer.stringVal();
                    
75                    lineNumber = 0;
                    
76                } else if (lexer.token() == JSONToken.LITERAL_INT) {
                    
77                    lineNumber = lexer.intValue();
                    
                
RedisScheduler.java https://gitlab.com/taichu/webmagic | Java | 128 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import org.apache.commons.codec.digest.DigestUtils;
                    
68                String field = DigestUtils.shaHex(request.getUrl());
                    
69                String value = JSON.toJSONString(request);
                    
70                jedis.hset((ITEM_PREFIX + task.getUUID()), field, value);
                    
88            if (bytes != null) {
                    
89                Request o = JSON.parseObject(new String(bytes), Request.class);
                    
90                return o;
                    
                
SqlDateDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 61 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
7
                    
8import com.alibaba.fastjson.JSONException;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
9import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
10import com.alibaba.fastjson.parser.JSONScanner;
                    
11import com.alibaba.fastjson.parser.JSONToken;
                    
17    @SuppressWarnings("unchecked")
                    
18    protected <T> T cast(DefaultJSONParser parser, Type clazz, Object fieldName, Object val) {
                    
19        if (val == null) {
                    
34
                    
35            JSONScanner dateLexer = new JSONScanner(strVal);
                    
36            if (dateLexer.scanISO8601DateIfMatch()) {
                    
51        } else {
                    
52            throw new JSONException("parse error : " + val);
                    
53        }
                    
                
FastJsonSerialization.java https://gitlab.com/zouxc/dubbo | Java | 50 lines
                    
15 */
                    
16package com.alibaba.dubbo.common.serialize.support.json;
                    
17
                    
27/**
                    
28 * FastJsonSerialization
                    
29 * 
                    
31 */
                    
32public class FastJsonSerialization implements Serialization {
                    
33
                    
42    public ObjectOutput serialize(URL url, OutputStream output) throws IOException {
                    
43        return new FastJsonObjectOutput(output);
                    
44    }
                    
46    public ObjectInput deserialize(URL url, InputStream input) throws IOException {
                    
47        return new FastJsonObjectInput(input);
                    
48    }
                    
                
SendDispatcher.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 60 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.exceptions.IMException;
                    
34
                    
35            String json = JSON.toJSONString(message);
                    
36            if (json == null) {
                    
36            if (json == null) {
                    
37                throw new IMException("Message to user " + userId + "can not be parsed to json correctly.");
                    
38            }
                    
39
                    
40            kafkaProducer.send(new ProducerRecord<String, String>(MessageTopic.TOPIC_DISPATCH_SEND_SINGLE, json));
                    
41        } catch (Exception e) {
                    
48        try {
                    
49            String json = JSON.toJSONString(message);
                    
50            if (json == null) {
                    
                
SerialWriterStringEncoder.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 75 lines
                    
1package com.alibaba.fastjson.serializer;
                    
2
                    
10
                    
11import com.alibaba.fastjson.JSONException;
                    
12import com.alibaba.fastjson.util.ThreadLocalCache;
                    
59			// so this shouldn't happen
                    
60			throw new JSONException(x.getMessage(), x);
                    
61		}
                    
                
AuthHandler.java https://gitlab.com/Mr.Tomato/linbox_server | Java | 264 lines
                    
2
                    
3import com.alibaba.fastjson.JSON;
                    
4import com.linbox.im.message.*;
                    
69    public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exception {
                    
70        logger.debug("Received AuthRequest. Message: {}", JSON.toJSONString(msg));
                    
71
                    
167
                    
168                    final MessageWrapper wrapper = JSON.parseObject(msg, MessageWrapper.class);
                    
169
                    
                
FastJsonObjectOutput.java https://gitlab.com/zouxc/dubbo | Java | 100 lines
                    
15 */
                    
16package com.alibaba.dubbo.common.serialize.support.json;
                    
17
                    
24import com.alibaba.dubbo.common.serialize.ObjectOutput;
                    
25import com.alibaba.fastjson.serializer.JSONSerializer;
                    
26import com.alibaba.fastjson.serializer.SerializeWriter;
                    
26import com.alibaba.fastjson.serializer.SerializeWriter;
                    
27import com.alibaba.fastjson.serializer.SerializerFeature;
                    
28
                    
33 */
                    
34public class FastJsonObjectOutput implements ObjectOutput {
                    
35
                    
37    
                    
38    public FastJsonObjectOutput(OutputStream out) {
                    
39        this(new OutputStreamWriter(out));
                    
                
UUIDDeserializer.java https://bitbucket.org/xiejuntao/xdesktop.git | Java | 27 lines
                    
1package com.alibaba.fastjson.parser.deserializer;
                    
2
                    
5
                    
6import com.alibaba.fastjson.parser.DefaultJSONParser;
                    
7import com.alibaba.fastjson.parser.JSONToken;
                    
12    @SuppressWarnings("unchecked")
                    
13    public <T> T deserialze(DefaultJSONParser parser, Type clazz, Object fieldName) {
                    
14        
                    
23
                    
24    public int getFastMatchToken() {
                    
25        return JSONToken.LITERAL_STRING;
                    
                
LoginUser.java https://gitlab.com/mrsunchangemyselfsun/ruoyi-vue | Java | 266 lines
                    
6import org.springframework.security.core.userdetails.UserDetails;
                    
7import com.alibaba.fastjson.annotation.JSONField;
                    
8import com.ruoyi.common.core.domain.entity.SysUser;
                    
121
                    
122    @JSONField(serialize = false)
                    
123    @Override
                    
137     */
                    
138    @JSONField(serialize = false)
                    
139    @Override
                    
149     */
                    
150    @JSONField(serialize = false)
                    
151    @Override
                    
161     */
                    
162    @JSONField(serialize = false)
                    
163    @Override
                    
                
 

Source

Language