corda/common/configuration-parsing
Anthony Keenan b7d04b1c6e
[CORDA-2235]: Add overrides for network parameters via command line and file (#4279)
* Temp commit

* Print the error message first by default, makes error output more natural.

* Polishing

* Further modifications after testing

* Documentation updates

* Couple of fixes after review

* Removing unnecessary tests

* Fix broken test

* Add interface to bootstrapper for testign

* Added unit tests

* Remove unused class

* Fix up bootstrapper unit tests and add a couple more

* Refactor the tests slightly

* Review comments

* Couple of minor tweaks
2018-11-26 17:11:05 +00:00
..
src [CORDA-2235]: Add overrides for network parameters via command line and file (#4279) 2018-11-26 17:11:05 +00:00
build.gradle Fixed missing entries for common modules in parent build.gradle file. (#4214) 2018-11-12 13:38:35 +00:00
README.md [CORDA-1778, CORDA-1835]: Decoupled configuration parsing mechanism (#4093) 2018-10-25 16:45:14 +01:00

configuration-parsing

This module provides types and functions to facilitate using Typesafe configuration objects.

Features

  1. A multi-step, structured validation framework for Typesafe configurations, allowing to merge Typesafe and application-level rules.
  2. A parsing framework, allowing to extract domain types from raw configuration objects in a versioned, type-safe fashion.
  3. A configuration description framework, allowing to print the expected schema of a configuration object.
  4. A configuration serialization framework, allowing to output the structure and values of a configuration object, potentially obfuscating sensitive data.

Concepts

The main idea is to create a Configuration.Specification to model the expected structure of a Typesafe configuration. The specification is then able to parse, validate, describe and serialize a raw Typesafe configuration.

By using VersionedConfigurationParser, it is possible to map specific versions to Configuration.Specifications and to parse and validate a raw configuration object based on a version header.

Refer to the following tests to gain an understanding of how the library works:

  • net.corda.common.configuration.parsing.internal.versioned.VersionedParsingExampleTest
  • net.corda.common.configuration.parsing.internal.SpecificationTest
  • net.corda.common.configuration.parsing.internal.SchemaTest