@Test public void testParse() { PropertiesConfigParser parser = new PropertiesConfigParser(); ConfigNode.ObjectNode node = parser.parse(createContent("aaa = bbb")); assertThat(node.entrySet(), hasSize(1)); assertThat(node.get("aaa"), valueNode("bbb")); }
@Override public ConfigNode.ObjectNode parse(ConfigParser.Content content) throws ConfigParserException { Properties properties = new Properties(); try { properties.load(content.data()); } catch (Exception e) { throw new ConfigParserException("Cannot read from source: " + e.getLocalizedMessage(), e); } return ConfigUtils.mapToObjectNode(ConfigUtils.propertiesToMap(properties), true); }
PropertiesConfigParser implements ConfigParser { @Override public ConfigNode.ObjectNode parse(ConfigParser.Content content) throws ConfigParserException { Properties properties = new Properties(); try { properties.load(content.data()); } catch (Exception e) { throw new ConfigParserException("Cannot read from source: " + e.getLocalizedMessage(), e); } return ConfigUtils.mapToObjectNode(ConfigUtils.propertiesToMap(properties), true); } }
PropertiesConfigParser implements ConfigParser { @Override public ConfigNode.ObjectNode parse(ConfigParser.Content content) throws ConfigParserException { Properties properties = new Properties(); try { properties.load(content.data()); } catch (Exception e) { throw new ConfigParserException("Cannot read from source: " + e.getLocalizedMessage(), e); } return ConfigUtils.mapToObjectNode(ConfigUtils.propertiesToMap(properties), true); }  }
PropertiesConfigParser implements ConfigParser { @Override public ConfigNode.ObjectNode parse(ConfigParser.Content content) throws ConfigParserException { Properties properties = new Properties(); try { properties.load(content.data()); } catch (Exception e) { throw new ConfigParserException("Cannot read from source: " + e.getLocalizedMessage(), e); } return ConfigUtils.mapToObjectNode(ConfigUtils.propertiesToMap(properties), true); }  @Override Set<String> supportedMediaTypes(); @Override ConfigNode.ObjectNode parse(ConfigParser.Content content); }
PropertiesConfigParser implements ConfigParser { @Override public ConfigNode.ObjectNode parse(ConfigParser.Content content) throws ConfigParserException { Properties properties = new Properties(); try { properties.load(content.data()); } catch (Exception e) { throw new ConfigParserException("Cannot read from source: " + e.getLocalizedMessage(), e); } return ConfigUtils.mapToObjectNode(ConfigUtils.propertiesToMap(properties), true); }  @Override Set<String> supportedMediaTypes(); @Override ConfigNode.ObjectNode parse(ConfigParser.Content content); static final String MEDIA_TYPE_TEXT_JAVA_PROPERTIES; static final int PRIORITY; }