Validating files having tree based structures

后端 未结 4 835
谎友^
谎友^ 2021-01-14 07:31

I am looking for a validator to validate tree structure based configuration files. e.g. a.student.name joe a.student.class arts

Can you suggest any ideas on valid

4条回答
  •  一整个雨季
    2021-01-14 08:00

    Unfortunately, schema validation for configuration files is rare outside of XML. The only other option I am aware of is Config4J (which I wrote).

    If you visit the website, then you should scroll down to the bottom of the main web page to access the complete set of manuals (available in both PDF and HTML versions). I recommend you have a look at the following parts of the manuals to get an overview of Config4J and decide if it satisfies your needs for validation.

    Chapters 2 and 3 of the "Getting Started Guide" provide an overview of the configuration syntax and the API. In particular, Section 3.10 provides a quick example of the schema language.

    Chapter 9 of the "Getting Started Guide" provides a complete definition of the schema language.

    Chapter 3 of the "Java API Guide" discusses the API for writing your own schema types to extend the functionality of the schema language.

    Update: I discovered from the answer by kiran.kumar M that the Java and Ruby implementations of YAML have a schema validator called Kwalify.

    Update: There is now a schema language for JSON.

提交回复
热议问题