@Test public void testAsProperties_XML_oneProperty() throws Exception { Properties properties = PropertiesHandler.asProperties( "<parameters>\n" + " <key>value1</key>\n" + "</parameters>" ); assertNotNull(properties); assertEquals(1, properties.size()); assertEquals("value1", properties.getProperty("key")); }
public static Properties asProperties(String processorParameters) throws IOException { Properties properties = new Properties(); if (StringUtils.isNotNullAndNotEmpty(processorParameters)) { Reader reader = new StringReader(processorParameters); try { if (isXml(processorParameters)) { handleChildElements(properties, createDomElement(reader), ""); } else { properties.load(reader); } } finally { reader.close(); } } return properties; }
PropertiesHandler { public static Properties asProperties(String processorParameters) throws IOException { Properties properties = new Properties(); if (StringUtils.isNotNullAndNotEmpty(processorParameters)) { Reader reader = new StringReader(processorParameters); try { if (isXml(processorParameters)) { handleChildElements(properties, createDomElement(reader), ""); } else { properties.load(reader); } } finally { reader.close(); } } return properties; } }
PropertiesHandler { public static Properties asProperties(String processorParameters) throws IOException { Properties properties = new Properties(); if (StringUtils.isNotNullAndNotEmpty(processorParameters)) { Reader reader = new StringReader(processorParameters); try { if (isXml(processorParameters)) { handleChildElements(properties, createDomElement(reader), ""); } else { properties.load(reader); } } finally { reader.close(); } } return properties; }  }
PropertiesHandler { public static Properties asProperties(String processorParameters) throws IOException { Properties properties = new Properties(); if (StringUtils.isNotNullAndNotEmpty(processorParameters)) { Reader reader = new StringReader(processorParameters); try { if (isXml(processorParameters)) { handleChildElements(properties, createDomElement(reader), ""); } else { properties.load(reader); } } finally { reader.close(); } } return properties; }  static Properties asProperties(String processorParameters); }
PropertiesHandler { public static Properties asProperties(String processorParameters) throws IOException { Properties properties = new Properties(); if (StringUtils.isNotNullAndNotEmpty(processorParameters)) { Reader reader = new StringReader(processorParameters); try { if (isXml(processorParameters)) { handleChildElements(properties, createDomElement(reader), ""); } else { properties.load(reader); } } finally { reader.close(); } } return properties; }  static Properties asProperties(String processorParameters);  }