NagyI
NagyI

Reputation: 5997

Validation of a properties file loaded with Apache Configurations

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

Answers (1)

Ciaran McHale
Ciaran McHale

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

Related Questions