@Test public void printsDetailedInformationOnMalformedContent() throws Exception { factory.build(malformedAdvancedFile); }
@Override public Pair<T, U> build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(requireNonNull(path))) { final JsonNode node = objectMapper.readTree(createParser(input)); if (node == null) { throw ConfigurationParsingException .builder("GJEXConfiguration at " + path + " must not be empty") .build(path); } return build(node, path); } catch (JsonParseException e) { throw ConfigurationParsingException .builder("Malformed " + formatName) .setCause(e) .setLocation(e.getLocation()) .setDetail(e.getMessage()) .build(path); } }
BaseConfigurationFactory implements ConfigurationFactory<T, U> { @Override public Pair<T, U> build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(requireNonNull(path))) { final JsonNode node = objectMapper.readTree(createParser(input)); if (node == null) { throw ConfigurationParsingException .builder("GJEXConfiguration at " + path + " must not be empty") .build(path); } return build(node, path); } catch (JsonParseException e) { throw ConfigurationParsingException .builder("Malformed " + formatName) .setCause(e) .setLocation(e.getLocation()) .setDetail(e.getMessage()) .build(path); } } }
BaseConfigurationFactory implements ConfigurationFactory<T, U> { @Override public Pair<T, U> build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(requireNonNull(path))) { final JsonNode node = objectMapper.readTree(createParser(input)); if (node == null) { throw ConfigurationParsingException .builder("GJEXConfiguration at " + path + " must not be empty") .build(path); } return build(node, path); } catch (JsonParseException e) { throw ConfigurationParsingException .builder("Malformed " + formatName) .setCause(e) .setLocation(e.getLocation()) .setDetail(e.getMessage()) .build(path); } } BaseConfigurationFactory(JsonFactory parserFactory,
                                    String formatName,
                                    Class<T> klass,
                                    Validator validator,
                                    ObjectMapper objectMapper); }
BaseConfigurationFactory implements ConfigurationFactory<T, U> { @Override public Pair<T, U> build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(requireNonNull(path))) { final JsonNode node = objectMapper.readTree(createParser(input)); if (node == null) { throw ConfigurationParsingException .builder("GJEXConfiguration at " + path + " must not be empty") .build(path); } return build(node, path); } catch (JsonParseException e) { throw ConfigurationParsingException .builder("Malformed " + formatName) .setCause(e) .setLocation(e.getLocation()) .setDetail(e.getMessage()) .build(path); } } BaseConfigurationFactory(JsonFactory parserFactory,
                                    String formatName,
                                    Class<T> klass,
                                    Validator validator,
                                    ObjectMapper objectMapper); @Override Pair<T, U> build(ConfigurationSourceProvider provider, String path); @Override Pair<T, U> build(); }
BaseConfigurationFactory implements ConfigurationFactory<T, U> { @Override public Pair<T, U> build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(requireNonNull(path))) { final JsonNode node = objectMapper.readTree(createParser(input)); if (node == null) { throw ConfigurationParsingException .builder("GJEXConfiguration at " + path + " must not be empty") .build(path); } return build(node, path); } catch (JsonParseException e) { throw ConfigurationParsingException .builder("Malformed " + formatName) .setCause(e) .setLocation(e.getLocation()) .setDetail(e.getMessage()) .build(path); } } BaseConfigurationFactory(JsonFactory parserFactory,
                                    String formatName,
                                    Class<T> klass,
                                    Validator validator,
                                    ObjectMapper objectMapper); @Override Pair<T, U> build(ConfigurationSourceProvider provider, String path); @Override Pair<T, U> build();  }