|
17 | 17 |
|
18 | 18 | package com.github.fge.jsonschema.process;
|
19 | 19 |
|
20 |
| -import com.fasterxml.jackson.core.JsonLocation; |
21 |
| -import com.fasterxml.jackson.core.JsonParseException; |
22 |
| -import com.fasterxml.jackson.core.JsonParser; |
23 | 20 | import com.fasterxml.jackson.core.JsonProcessingException;
|
24 | 21 | import com.fasterxml.jackson.databind.JsonNode;
|
25 |
| -import com.fasterxml.jackson.databind.MappingIterator; |
26 | 22 | import com.fasterxml.jackson.databind.ObjectMapper;
|
27 | 23 | import com.fasterxml.jackson.databind.node.ArrayNode;
|
28 | 24 | import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
@@ -142,27 +138,4 @@ private static JsonNode buildReport(final ProcessingReport report)
|
142 | 138 | ret.add(message.asJson());
|
143 | 139 | return ret;
|
144 | 140 | }
|
145 |
| - private static JsonNode readOne(final String input) |
146 |
| - throws IOException |
147 |
| - { |
148 |
| - final MappingIterator<JsonNode> iterator; |
149 |
| - final JsonNode ret; |
150 |
| - final JsonLocation location; |
151 |
| - |
152 |
| - try ( |
153 |
| - final StringReader reader = new StringReader(input); |
154 |
| - final JsonParser parser = MAPPER.getFactory().createParser(reader); |
155 |
| - ) { |
156 |
| - iterator = MAPPER.readValues(parser, JsonNode.class); |
157 |
| - if (!iterator.hasNextValue()) |
158 |
| - throw new JsonParseException("no data", |
159 |
| - new JsonLocation(reader, 0L, 1, 1)); |
160 |
| - ret = iterator.nextValue(); |
161 |
| - location = parser.getCurrentLocation(); |
162 |
| - if (!iterator.hasNextValue()) |
163 |
| - return ret; |
164 |
| - throw new JsonParseException("extra data after first node", |
165 |
| - location); |
166 |
| - } |
167 |
| - } |
168 | 141 | }
|
0 commit comments