Reputation: 5997
I'm looking for a Java configuration framework for one of our projects and Apache Configurations looks very promising.
I need to define rules about config files which are used by validation on loading. I see that Apache Configurations can do this with XML files because it can use XSD validation. However i haven't found anything similar for pure property files yet. What i need is something like defining an additional property file which contains the required rules. Say for example:
config.key.which.is.optional.and.int=optional,int
config.key.which.is.required.and.string=required,string
Is there any ready made solution for this? Or is there a similar framework to Apache Configurations which can do this?
Upvotes: 2
Views: 2585
Reputation: 2244
I am not aware of any schema validation mechanisms for Java properties. Ten months ago (in May 2011), I offered a bounty for information on configuration languages other than XML that provide schema validation. Unfortunately, such configuration languages are few and far between.
Here is a link to the bountied question, in case you want to see the sparseness of the responses.
Upvotes: 2