commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-401) HierarchicalConfiguration does not support hierarchy from property files
Date Tue, 10 Nov 2009 19:25:28 GMT


Oliver Heger commented on CONFIGURATION-401:

In your special example the {{PropertiesConfiguration}} contains 3 keys: _persons.person.name_,
_persons.person.surName_, and _persons.person.phoneNum_. Each key is associated with a list
of values. In this concrete case it is possible to convert this data into a hierarchical structure.

But as soon as the structure becomes slightly more complex, you are lost. Consider the example
where persons are organized in groups, and you have properties like


Here you have two groups and three persons, but after the properties are read into a {{PropertiesConfiguration}}
how do you know which persons belong to which group?

You try to extract structure from a format that is simply not provided.

> HierarchicalConfiguration does not support hierarchy  from property files
> -------------------------------------------------------------------------
>                 Key: CONFIGURATION-401
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: Expression engine
>    Affects Versions: 1.6
>         Environment: windows/Linux
>            Reporter: yair ogen
> If you have hierarchy like this:
> persons.person.surName=2
> persons.person.phoneNum=3
> persons.person.surName=5
> persons.person.phoneNum=6
> persons.person.surName=8
> persons.person.phoneNum=9
> If I have a regular property configuration that loaded a file containing in the above.
then I transform into HierarchicalConfiguration  using: ConfigurationUtils.convertToHierarchical(configuration).
> The tree is not right.
> I can do this:
> hierarchicalConfiguration.subset("persons").subset("person(0)").getKeys()
> but this returned empty iterator:
> hierarchicalConfiguration.subset("persons").subset("person(1)").getKeys()
> Only the first person is available.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message