Hey! I'd like to allow users of our web application to edit its configuration files through the web interface, and I've got the following idea of how to do it (and by the way, I am NOT considering using XML for configuration).
Say you've got a standard .properties file, like:
prop1.displayName=Property 1
prop1.possibleValues=1,2,3,a,b,c
prop1.value=2
prop2.displayName=Property 2
prop2.possibleValues=foo,bar,baz
prop2.value=baz
I'd like to get some type of objects back from reading this properties file which would give me something like the following:
Class: EnhancedProperties // represents the entire file
- Members:
- List properties // one entry for each main property, in our case, we'd have 2 entries (prop1 and prop2)
Class: EnhancedProperty // represents one entry from the EnhancedProperties class
- Members
- String name // in our case, "prop1"
- String displayName // in our case, "Property 1"
- String [] possibleValues // in our case, {"1","2","3","a","b","c"}
- String value // in our case, 2
Using this class, we'd automatically get all main properties, a list of their possible values (for dropdowns), a display name, and a current value, all stored in one place.
Does anyone know of anything out there similar to this? Or for that matter, something that will make config file editing for users of a UI as easy to add as this?