Collect the first matched value and stop parsing immediately

@param reader json reader
@param paths  JsonPath
@return Matched value
@deprecated use {@link #collectOne(InputStream, JsonPath...)} instead
512582
@Deprecated
    public Object collectOne(Reader reader, JsonPath... paths) {
        return collectOne(reader, Object.class, paths);
    }
1288965
private List<Object> getCollectionValue(JsonParser jsonParser) throws IOException {
        LOG.info("Start parsing {} array", jsonParser.getCurrentName());
        List<Object> list = new ArrayList<>();
        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
            if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
                Object embedded = getEmbeddedObject(jsonParser);
                list.add(embedded);
            }
            if (!"}".equals(jsonParser.getText())) {
                list.add(jsonParser.getText());
            } else {
                LOG.info("Array is over.");
            }
        }
        return list;
    }
538365
public <V> V convertFrom(final JsonReader reader) {
        if (reader == null) return null;
        return (V) new AnyDecoder(factory).convertFrom(reader);
    }
637274
public <T> T parse(Reader in, Class<T> mapTo) throws ParseException {
		return getPStream().parse(in, JSONValue.defaultReader.getMapper(mapTo));
	}
606529
public Collection<Object> collectAll(InputStream inputStream, String... paths) {
        return collectAll(inputStream, compile(paths));
    }
885255
public Collection<Object> collectAll(String json, JsonPath... paths) {
        return collectAll(json, Object.class, paths);
    }
1262698
@Override
	public JacksonWrapperParser createParser(Reader reader) {
		try {
			return new JacksonWrapperParser(innerFactory.createParser(reader), getSupportedFormat());
		} catch (IOException e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
1063888
public Object parse(Reader in) throws ParseException {
		return parse(in, JSONValue.defaultReader.DEFAULT);
	}
225648
public static JsonElement parseReader(JsonReader reader)
      throws JsonIOException, JsonSyntaxException {
    boolean lenient = reader.isLenient();
    reader.setLenient(true);
    try {
      return Streams.parse(reader);
    } catch (StackOverflowError e) {
      throw new JsonParseException("Failed parsing JSON source: " + reader + " to Json", e);
    } catch (OutOfMemoryError e) {
      throw new JsonParseException("Failed parsing JSON source: " + reader + " to Json", e);
    } finally {
      reader.setLenient(lenient);
    }
  }
452179
public static Object jsonValue(JsonReader reader) throws IOException {
        switch (reader.peek()) {
            case STRING:
                return reader.nextString();
            case BOOLEAN:
                return reader.nextBoolean();
            case NUMBER:
                try {
                    return reader.nextLong();
                } catch (NumberFormatException nfex) {
                    return reader.nextDouble();
                }
            case BEGIN_ARRAY:
                ArrayList<Object> list = new ArrayList<>();
                reader.beginArray();
                while (reader.peek() != JsonToken.END_ARRAY) {
                    list.add(jsonValue(reader));
                }
                reader.endArray();
                return list;
            case BEGIN_OBJECT:
                return jsonMap(reader);
            default:
                reader.skipValue();
        }
        return null;
    }
1109346
public static List<File> pathsFiles(final String paths, final Predicate<File> predicate) {
        final List<File> files = new ArrayList<File>();
        for (final String filePathAndName : paths.split(File.pathSeparator)) {
            final File file = new File(filePathAndName);
            if (file.isDirectory()) {
                try (final Stream<Path> stream = Files.walk(file.toPath(), Integer.MAX_VALUE)) {
                    stream.map(f -> f.toFile()).filter(predicate).forEach(files::add);
                } catch (final IOException ex) {
                    throw new RuntimeException("Error walking path: " + file, ex);
                }
            } else {
                if (predicate.test(file)) {
                    files.add(file);
                }
            }
        }
        return files;
    }
98073
private static Object readValue(JsonReader reader) throws IOException {
    JsonToken token = reader.peek();
    switch (token) {
      case BEGIN_OBJECT:
        return readerToMap(reader);
      case BEGIN_ARRAY:
        return readerToList(reader);
      case BOOLEAN:
        return reader.nextBoolean();
      case NULL:
        reader.nextNull(); // consume the null token
        return null;
      case NUMBER:
        return reader.nextDouble();
      case STRING:
        return reader.nextString();
      default:
        throw new IllegalStateException("Invalid token " + token);
    }
  }
1122542
public Object collectOne(InputStream inputStream, String... paths) {
        return collectOne(inputStream, compile(paths));
    }
395654
@Deprecated
	public static <T> T load(ReaderHandler<T> readerHandler, String path, String charset) throws IORuntimeException {
		return FileReader.create(file(path), CharsetUtil.charset(charset)).read(readerHandler);
	}
377385
public static Config fromJSON(Reader reader) throws IOException {
        ConfigSupport support = new ConfigSupport();
        return support.fromJSON(reader, Config.class);
    }
1007550
public <T> T parse(Reader in, JsonReaderI<T> mapper) throws ParseException {
		this.base = mapper.base;
		//
		this.in = in;
		return super.parse(mapper);
	}
94792
@SuppressWarnings("unchecked")
    public <T> T collectOne(InputStream inputStream, Class<T> tClass, JsonPath... paths) {
        CollectOneListener listener = new CollectOneListener(true);
        SurfingConfiguration.Builder builder = configBuilder().skipOverlappedPath();
        for (JsonPath jsonPath : paths) {
            builder.bind(jsonPath, listener);
        }
        surf(inputStream, builder.build());
        Object value = listener.getValue();
        return tClass.cast(jsonProvider.cast(value, tClass));
    }