|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
* Copyright 2012-2022 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.
|
|
|
@ -41,12 +41,14 @@ public class GsonJsonParser extends AbstractJsonParser {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> parseMap(String json) {
|
|
|
|
public Map<String, Object> parseMap(String json) {
|
|
|
|
return parseMap(json, (trimmed) -> this.gson.fromJson(trimmed, MAP_TYPE.getType()));
|
|
|
|
return tryParse(() -> parseMap(json, (trimmed) -> this.gson.fromJson(trimmed, MAP_TYPE.getType())),
|
|
|
|
|
|
|
|
Exception.class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<Object> parseList(String json) {
|
|
|
|
public List<Object> parseList(String json) {
|
|
|
|
return parseList(json, (trimmed) -> this.gson.fromJson(trimmed, LIST_TYPE.getType()));
|
|
|
|
return tryParse(() -> parseList(json, (trimmed) -> this.gson.fromJson(trimmed, LIST_TYPE.getType())),
|
|
|
|
|
|
|
|
Exception.class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static final class MapTypeToken extends TypeToken<Map<String, Object>> {
|
|
|
|
private static final class MapTypeToken extends TypeToken<Map<String, Object>> {
|
|
|
|