This is an automated email from the ASF dual-hosted git repository. anatole pushed a commit to branch vote-0.4-incubating-01 in repository https://gitbox.apache.org/repos/asf/incubator-tamaya-site.git
commit 1eb836caadbfa70c854fe5849a0d6fa86996602c Author: Anatole Tresch <[email protected]> AuthorDate: Tue May 14 14:42:47 2019 +0200 TAMAYA-398 TAMAYA-399 TAMAYA-400 TAMAYA-401 TAMAYA-402 TAMAYA-403 TAMAYA-404 TAMAYA-405 TAMAYA-406 TAMAYA-407 Added/updated docs. --- content/documentation/extensions.adoc | 3 +- .../extensions/{mod_json.adoc => mod_hjson.adoc} | 45 ++++++++++++---------- .../extensions/{mod_json.adoc => mod_hocon.adoc} | 43 ++++++++++++--------- content/documentation/extensions/mod_json.adoc | 12 +++--- 4 files changed, 57 insertions(+), 46 deletions(-) diff --git a/content/documentation/extensions.adoc b/content/documentation/extensions.adoc index a71a749..e065308 100644 --- a/content/documentation/extensions.adoc +++ b/content/documentation/extensions.adoc @@ -21,6 +21,8 @@ Mature extensions have a stable API and SPI, similar to the API and Implementati |+org.apache.tamaya.ext:tamaya-formats+ |Provides an abstract model for configuration formats |link:extensions/mod_formats.html[Documentation] |+org.apache.tamaya.ext:tamaya-functions+ |Provides several functional extension points. |link:extensions/mod_functions.html[Documentation] |+org.apache.tamaya.ext:tamaya-hazelcast+ |Integration with Hazelcast datagrids. |link:extensions/mod_hazelcast.html[Documentation] +|+org.apache.tamaya.ext:tamaya-hocon+ |Provides format support for HOCON based configuration. |link:extensions/mod_hocon.html[Documentation] +|+org.apache.tamaya.ext:tamaya-hjson+ |Provides format support for HJSON based configuration. |link:extensions/mod_hjson.html[Documentation] |+org.apache.tamaya.ext:tamaya-injection-api+ |Provides Tamaya's injection annotations API. |link:extensions/mod_injection.html[Documentation] |+org.apache.tamaya.ext:tamaya-injection+ |Provides configuration injection services and configuration template support. |link:extensions/mod_injection.html[Documentation] |+org.apache.tamaya.ext:tamaya-injection-cdi+ | Java EE/standalone compliant CDI integration using CDI for injection. | link:extensions/mod_cdi.html[Documentation] @@ -50,7 +52,6 @@ us getting them stable and well tested! |+org.apache.tamaya.ext:tamaya-camel_beta+ |Integration with Apache Camel. | link:extensions/mod_camel.html[Documentation] |+org.apache.tamaya.ext:tamaya-commons-config_beta+ |Integration Support for Apache Commons. | - |+org.apache.tamaya.ext:tamaya-doc_alpha+ |Provides support for generating Configuration Documentation. | - -|+org.apache.tamaya.ext:tamaya-hjson_alpha+ |Provides support for using HJSON as configuration format. | - |+org.apache.tamaya.ext:tamaya-jodatime_beta+ |Provides support for JodaTime. | link:extensions/mod_jodatime.html[Documentation] |+org.apache.tamaya.ext:tamaya-jsr382+ |Implementation of the current JSR 382 API. | - (Checkout the JSR's documentation) |+org.apache.tamaya.ext:tamaya-management_alpha+ |Provides JMX support for inspecting configuration. | link:extensions/mod_management.html[Documentation] diff --git a/content/documentation/extensions/mod_json.adoc b/content/documentation/extensions/mod_hjson.adoc similarity index 57% copy from content/documentation/extensions/mod_json.adoc copy to content/documentation/extensions/mod_hjson.adoc index ee2323c..6ff79ce 100644 --- a/content/documentation/extensions/mod_json.adoc +++ b/content/documentation/extensions/mod_hjson.adoc @@ -1,40 +1,45 @@ :jbake-type: page :jbake-status: published -= Apache Tamaya - Extension: Builder += Apache Tamaya - Extension: HJSON Format toc::[] -[[JSON]] -== Tamaya JSON (Extension Module) -Tamaya _JSON_ is an extension module. Refer to the link:../extensions.html[extensions documentation] for further details. +[[HJSON]] +== Tamaya HJSON (Extension Module) +Tamaya _HJSON_ is an extension module. Refer also to the link:../extensions.html[extensions documentation] for further details. === What functionality this module provides ? -Tamaya _JSON_ provides support for reading configuration using JSON -format: +Tamaya _HJSON_ provides support for reading configuration in HJSON, a JSP similar format better +suited for humans: -[source, json] +[source, hjson] ----------------------------------------------- { - "a.b"{ - "key1": "blabla", - "key2": true, + a : A + b : { + o : O + p : P } + c : C } ----------------------------------------------- Hereby the hierarchical structure of the JSON document will be mapped to a -flat key-value pairs of type `String`, e.g. the bove will be mapped to +corresponding `PropertyValue` tree structure. This strucuture can be mapped +to flat key-value pairs of type `String`, e.g. the bove will be mapped to [source, properties] ----------------------------------------------- -a.b.key1=blabla -a.b.key2=true +a=A +b.o=O +b.p=P +c=C ----------------------------------------------- -This extension uses SPI defined by the +tamaya.formats+ extension module. +This extension implements the SPI defined by the +tamaya.formats+ extension module. === Compatibility @@ -44,13 +49,13 @@ The module is based on Java 8. === Installation -To use the JSON extension module you only must add the corresponding dependency to your module: +To use the HJSON extension module you only must add the corresponding dependency to your module: [source, xml] ----------------------------------------------- <dependency> <groupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-json</artifactId> + <artifactId>tamaya-hjson</artifactId> <version>{tamaya_version}</version> </dependency> ----------------------------------------------- @@ -58,15 +63,15 @@ To use the JSON extension module you only must add the corresponding dependency This extension also transitively requires the +tamaya.formats+ module. -=== Reading configuration in JSON +=== Reading configuration in HJSON -For reading JSON based onfiguration most easily a +JSONFormat+ can be +For reading HJSON based onfiguration most easily a +HJSONFormat+ can be used: [source, java] ----------------------------------------------- ConfigurationData dataRead = ConfigurationFormats.getInstance().readConfig( - getClassLoader().getResource("myFileConfig.json"), new JSONFormat())); + getClassLoader().getResource("myFileConfig.json"), new HJSONFormat())); ----------------------------------------------- Or, if you are fine with the _default_ mapping you can directly create a @@ -76,5 +81,5 @@ registers the _json_ format automatically using the `ServiceContext`): [source, java] ----------------------------------------------- PropertySource ps = ConfigurationFormats.getInstance().createPropertySource( - getClassLoader().getResource("myFileConfig.json")); + getClassLoader().getResource("myFileConfig.hjson")); ----------------------------------------------- diff --git a/content/documentation/extensions/mod_json.adoc b/content/documentation/extensions/mod_hocon.adoc similarity index 55% copy from content/documentation/extensions/mod_json.adoc copy to content/documentation/extensions/mod_hocon.adoc index ee2323c..15aa87e 100644 --- a/content/documentation/extensions/mod_json.adoc +++ b/content/documentation/extensions/mod_hocon.adoc @@ -1,40 +1,45 @@ :jbake-type: page :jbake-status: published -= Apache Tamaya - Extension: Builder += Apache Tamaya - Extension: HOCON Format toc::[] [[JSON]] == Tamaya JSON (Extension Module) -Tamaya _JSON_ is an extension module. Refer to the link:../extensions.html[extensions documentation] for further details. +Tamaya _JSON_ is an extension module. Refer also to the link:../extensions.html[extensions documentation] for further details. === What functionality this module provides ? -Tamaya _JSON_ provides support for reading configuration using JSON -format: +Tamaya _HOCON_ provides support for reading configuration using Human Optimized Configuration) HOCON +format as defined by http://https://lightbend.github.io/config/[Lightbend Typesafe Config]: -[source, json] +[source, hcon] ----------------------------------------------- { - "a.b"{ - "key1": "blabla", - "key2": true, + a : A + b : B + c { + o: O + p: P } } ----------------------------------------------- -Hereby the hierarchical structure of the JSON document will be mapped to a -flat key-value pairs of type `String`, e.g. the bove will be mapped to +Hereby the hierarchical structure of the HOCON document will be mapped +into an according `PropertyValue` tree structure. By default this structure can be +mapped to flat key-value pairs of type `String`, e.g. the bove will be mapped to [source, properties] ----------------------------------------------- -a.b.key1=blabla -a.b.key2=true +a=A +b=B +c.o=O +c.p=P ----------------------------------------------- -This extension uses SPI defined by the +tamaya.formats+ extension module. +This extension implements the SPI defined by the +tamaya.formats+ extension module. === Compatibility @@ -50,7 +55,7 @@ To use the JSON extension module you only must add the corresponding dependency ----------------------------------------------- <dependency> <groupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-json</artifactId> + <artifactId>tamaya-hocon</artifactId> <version>{tamaya_version}</version> </dependency> ----------------------------------------------- @@ -58,23 +63,23 @@ To use the JSON extension module you only must add the corresponding dependency This extension also transitively requires the +tamaya.formats+ module. -=== Reading configuration in JSON +=== Reading configuration in HOCON -For reading JSON based onfiguration most easily a +JSONFormat+ can be +For reading HOCON based onfiguration most easily a +HOCONFormat+ can be used: [source, java] ----------------------------------------------- ConfigurationData dataRead = ConfigurationFormats.getInstance().readConfig( - getClassLoader().getResource("myFileConfig.json"), new JSONFormat())); + getClassLoader().getResource("myFileConfig.hocon"), new HOCONFormat())); ----------------------------------------------- Or, if you are fine with the _default_ mapping you can directly create a +PropertySource+ using the _formats_ API (this works since this module -registers the _json_ format automatically using the `ServiceContext`): +registers the _hocon_ format automatically in the `ServiceContext`): [source, java] ----------------------------------------------- PropertySource ps = ConfigurationFormats.getInstance().createPropertySource( - getClassLoader().getResource("myFileConfig.json")); + getClassLoader().getResource("myFileConfig.hocon")); ----------------------------------------------- diff --git a/content/documentation/extensions/mod_json.adoc b/content/documentation/extensions/mod_json.adoc index ee2323c..9df73c7 100644 --- a/content/documentation/extensions/mod_json.adoc +++ b/content/documentation/extensions/mod_json.adoc @@ -1,19 +1,18 @@ :jbake-type: page :jbake-status: published -= Apache Tamaya - Extension: Builder += Apache Tamaya - Extension: JSON Format toc::[] [[JSON]] == Tamaya JSON (Extension Module) -Tamaya _JSON_ is an extension module. Refer to the link:../extensions.html[extensions documentation] for further details. +Tamaya _JSON_ is an extension module. Refer also to the link:../extensions.html[extensions documentation] for further details. === What functionality this module provides ? -Tamaya _JSON_ provides support for reading configuration using JSON -format: +Tamaya _JSON_ provides support for reading configuration in JSON (Java Serializued Object Notation): [source, json] ----------------------------------------------- @@ -26,7 +25,8 @@ format: ----------------------------------------------- Hereby the hierarchical structure of the JSON document will be mapped to a -flat key-value pairs of type `String`, e.g. the bove will be mapped to +corresponding `PropertyValue` tree structure. This strucuture can be mapped +to flat key-value pairs of type `String`, e.g. the bove will be mapped to [source, properties] ----------------------------------------------- @@ -34,7 +34,7 @@ a.b.key1=blabla a.b.key2=true ----------------------------------------------- -This extension uses SPI defined by the +tamaya.formats+ extension module. +This extension implements the SPI defined by the +tamaya.formats+ extension module. === Compatibility
