You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/08/06 01:03:12 UTC
[2/2] incubator-tamaya git commit: TAMAYA-82: Added doc for json
module.
TAMAYA-82: Added doc for json module.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/c1c1122c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/c1c1122c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/c1c1122c
Branch: refs/heads/master
Commit: c1c1122cec6fde37c9bed5b6b96e2a7e38a0a602
Parents: 96d8066
Author: anatole <at...@gmail.com>
Authored: Thu Aug 6 00:50:06 2015 +0200
Committer: anatole <at...@gmail.com>
Committed: Thu Aug 6 00:50:06 2015 +0200
----------------------------------------------------------------------
docs/src/main/asciidoc/mod_json.adoc | 98 +++++++++++++++++++++++++++++++
docs/src/main/asciidoc/modules.adoc | 1 +
2 files changed, 99 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c1c1122c/docs/src/main/asciidoc/mod_json.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/mod_json.adoc b/docs/src/main/asciidoc/mod_json.adoc
new file mode 100644
index 0000000..8b2eace
--- /dev/null
+++ b/docs/src/main/asciidoc/mod_json.adoc
@@ -0,0 +1,98 @@
+= Apache Tamaya -- Extension: Builder
+
+:name: Tamaya
+:rootpackage: org.apache.tamaya.builder
+:title: Apache Tamaya Extension: JSON
+:revnumber: 0.1.1
+:revremark: Incubator
+:revdate: March 2015
+:longversion: {revnumber} ({revremark}) {revdate}
+:authorinitials: ATR
+:author: Anatole Tresch
+:email: <an...@apache.org>
+:source-highlighter: coderay
+:website: http://tamaya.incubator.apache.org/
+:toc:
+:toc-placement: manual
+:encoding: UTF-8
+:numbered:
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+'''
+
+<<<
+
+toc::[]
+
+<<<
+:numbered!:
+<<<
+[[BuilderCore]]
+== Tamaya JSON (Extension Module)
+=== Overview
+
+The Tamaya json module provides support for reading configuration using the JSON format:
+
+
+=== Compatibility
+
+The module is based on Java 7, so it will not run on Java 7 and beyond.
+
+
+=== Installation
+
+To benefit from configuration builder support you only must add the corresponding dependency to your module:
+
+[source, xml]
+-----------------------------------------------
+<dependency>
+ <groupId>org.apache.tamaya.ext</groupId>
+ <artifactId>tamaya-json</artifactId>
+ <version>{tamayaVersion}</version>
+</dependency>
+-----------------------------------------------
+
+
+=== Reading configuration in JSON
+
+For reading JSON based onfiguration most easily a +JSONFormat+ can be provided:
+
+[source, java]
+-----------------------------------------------
+ConfigurationData dataRead = ConfigurationFormats.readConfig(
+ getClassLoader().getResource("myFileConfig.json"), new JSonFOrmat()));
+-----------------------------------------------
+
+=== Examples
+
+The JSON module adds instances of +ConfigurationFormat+ so JSON configuration can be read and mapped to the
+according property maps. E.g. the following file is a simple and correct JSON configuration:
+
+[source,listing]
+----------------------------------------------------------------
+{
+ "a" : "A",
+ "b" : "B",
+ "c" : "C",
+ "d" : {
+ "o" : "O",
+ "p" : "P"
+ }
+}
+----------------------------------------------------------------
+
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/c1c1122c/docs/src/main/asciidoc/modules.adoc
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/modules.adoc b/docs/src/main/asciidoc/modules.adoc
index e76c408..064560b 100644
--- a/docs/src/main/asciidoc/modules.adoc
+++ b/docs/src/main/asciidoc/modules.adoc
@@ -61,6 +61,7 @@ NOTE All extensions, despite the _tamaya-builder_ module, currently run on Java
|+org.apache.tamaya.ext:tamaya-events+ |Provides support for publishing configuration changes |link:mod_events.html[Documentation]
|+org.apache.tamaya.ext:tamaya-formats+ |Provides an abstract model for configuration formats |link:mod_formats.html[Documentation]
|+org.apache.tamaya.ext:tamaya-injection+ |Provides configuration injection services and congiruation template support. |link:mod_injection.html[Documentation]
+|+org.apache.tamaya.ext:tamaya-json+ |Provides format support for JSON based configuration. |link:json.html[Documentation]
|=======