Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
2.0-alpha1
-
None
Description
This issue can be easily reproduced!
Create a configuration files like this:
config.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?> <configuration> <system /> <xml fileName="myproperties.xml" config-name="properties" /> </configuration>
<?xml version="1.0" encoding="UTF-8"?> <properties> <colors.pie>#FF0000, #00FF00</colors.pie> </properties>
Java code:
DefaultExpressionEngineSymbols symbols = new DefaultExpressionEngineSymbols.Builder( DefaultExpressionEngineSymbols.DEFAULT_SYMBOLS) // Use a slash as property delimiter instead of dot .setPropertyDelimiter("/").create(); DefaultExpressionEngine engine = new DefaultExpressionEngine(symbols); // Now create a configuration using this expression engine Parameters params = new Parameters(); DefaultListDelimiterHandler listDelimiterHandler = new DefaultListDelimiterHandler(','); XMLBuilderParameters xmlBuilderParameters = params.xml() .setFileName("config.xml").setExpressionEngine(engine) .setListDelimiterHandler(listDelimiterHandler); dcb = new CombinedConfigurationBuilder().configure(xmlBuilderParameters); try { config = dcb.getConfiguration(); } catch (ConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); }
I could not retrieving values of colors.pie using:
config.getStringArray("colors.pie");
The result is a single string "#FF0000, #00FF00" instead of an array of Strings.
However, using Java code to add a new property like this:
config.addProperty("my.test.value", "#FF0000, #00FF00"),
I can get an array as the result of :
config.getStringArray("my.test.value");