|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2016 the original author or authors.
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -31,6 +31,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Jean de Klerk
|
|
|
|
* @author Jean de Klerk
|
|
|
|
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
* @since 1.2.0
|
|
|
|
* @since 1.2.0
|
|
|
|
* @see JsonParserFactory
|
|
|
|
* @see JsonParserFactory
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -112,12 +113,7 @@ public class BasicJsonParser implements JsonParser {
|
|
|
|
for (String pair : tokenize(json)) {
|
|
|
|
for (String pair : tokenize(json)) {
|
|
|
|
String[] values = StringUtils.trimArrayElements(StringUtils.split(pair, ":"));
|
|
|
|
String[] values = StringUtils.trimArrayElements(StringUtils.split(pair, ":"));
|
|
|
|
String key = trimLeadingCharacter(trimTrailingCharacter(values[0], '"'), '"');
|
|
|
|
String key = trimLeadingCharacter(trimTrailingCharacter(values[0], '"'), '"');
|
|
|
|
Object value = null;
|
|
|
|
Object value = parseInternal(values[1]);
|
|
|
|
if (values.length > 0) {
|
|
|
|
|
|
|
|
String string = trimLeadingCharacter(
|
|
|
|
|
|
|
|
trimTrailingCharacter(values[1], '"'), '"');
|
|
|
|
|
|
|
|
value = parseInternal(string);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
map.put(key, value);
|
|
|
|
map.put(key, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return map;
|
|
|
|
return map;
|
|
|
|