1
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3
+ ** Table of Contents** * generated with [ DocToc] ( http://doctoc.herokuapp.com/ ) *
4
+
5
+ - [ Overview] ( #overview )
6
+ - [ Essential Information] ( #essential-information )
7
+ - [ License] ( #license )
8
+ - [ Binary Releases] ( #binary-releases )
9
+ - [ Release Notes] ( #release-notes )
10
+ - [ API docs] ( #api-docs )
11
+ - [ Bugs and Patches] ( #bugs-and-patches )
12
+ - [ Build] ( #build )
13
+ - [ Using the Library] ( #using-the-library )
14
+ - [ API Example] ( #api-example )
15
+ - [ Longer Examples] ( #longer-examples )
16
+ - [ Schemas and Validation] ( #schemas-and-validation )
17
+ - [ Standard behavior] ( #standard-behavior )
18
+ - [ Merging config trees] ( #merging-config-trees )
19
+ - [ How to handle defaults] ( #how-to-handle-defaults )
20
+ - [ Using HOCON, the JSON Superset] ( #using-hocon-the-json-superset )
21
+ - [ Features of HOCON] ( #features-of-hocon )
22
+ - [ Examples of HOCON] ( #examples-of-hocon )
23
+ - [ Uses of Substitutions] ( #uses-of-substitutions )
24
+ - [ Factor out common values] ( #factor-out-common-values )
25
+ - [ Inheritance] ( #inheritance )
26
+ - [ Optional system or env variable overrides] ( #optional-system-or-env-variable-overrides )
27
+ - [ Concatenation] ( #concatenation )
28
+ - [ Miscellaneous Notes] ( #miscellaneous-notes )
29
+ - [ Debugging Your Configuration] ( #debugging-your-configuration )
30
+ - [ Java version] ( #java-version )
31
+ - [ Rationale for Supported File Formats] ( #rationale-for-supported-file-formats )
32
+ - [ Other APIs] ( #other-apis )
33
+
34
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
35
+
1
36
Configuration library for JVM languages.
2
37
3
38
## Overview
@@ -32,11 +67,13 @@ custom code. The library has nice support for merging
32
67
configurations so if you build one from a custom source it's easy
33
68
to merge it in.
34
69
35
- ## License
70
+ ## Essential Information
71
+
72
+ ### License
36
73
37
74
The license is Apache 2.0, see LICENSE-2.0.txt.
38
75
39
- ## Binary Releases
76
+ ### Binary Releases
40
77
41
78
You can find published releases (compiled for Java 6 and above) on
42
79
Maven Central.
@@ -51,20 +88,20 @@ Obsolete releases are here, but you probably don't want these:
51
88
52
89
- http://repo.typesafe.com/typesafe/releases/com/typesafe/config/config/
53
90
54
- ## Release Notes
91
+ ### Release Notes
55
92
56
93
Please see NEWS.md in this directory,
57
94
https://github.com/typesafehub/config/blob/master/NEWS.md
58
95
59
- ## API docs
96
+ ### API docs
60
97
61
98
- Online: http://typesafehub.github.com/config/latest/api/
62
99
- also published in jar form
63
100
- consider reading this README first for an intro
64
101
- for questions about the ` .conf ` file format, read HOCON.md in
65
102
this directory
66
103
67
- ## Bugs and Patches
104
+ ### Bugs and Patches
68
105
69
106
Report bugs to the GitHub issue tracker. Send patches as pull
70
107
requests on GitHub.
@@ -74,20 +111,22 @@ Typesafe Contributor License Agreement online, using your GitHub
74
111
account - it takes 30 seconds. You can do this at
75
112
http://www.typesafe.com/contribute/cla
76
113
77
- ## Build
114
+ ### Build
78
115
79
116
The build uses sbt and the tests are written in Scala; however,
80
117
the library itself is plain Java and the published jar has no
81
118
Scala dependency.
82
119
83
- ## API Example
120
+ ## Using the Library
121
+
122
+ ### API Example
84
123
85
124
Config conf = ConfigFactory.load();
86
125
int bar1 = conf.getInt("foo.bar");
87
126
Config foo = conf.getConfig("foo");
88
127
int bar2 = foo.getInt("bar");
89
128
90
- ## Longer Examples
129
+ ### Longer Examples
91
130
92
131
See the examples in the ` examples/ ` directory.
93
132
@@ -107,7 +146,7 @@ In brief, as shown in the examples:
107
146
format or data source you like with the methods in
108
147
` ConfigValueFactory ` .
109
148
110
- ## Schemas and Validation
149
+ ### Schemas and Validation
111
150
112
151
There isn't a schema language or anything like that. However, two
113
152
suggested tools are:
@@ -132,7 +171,7 @@ In Scala, a Settings class might look like:
132
171
133
172
See the examples/ directory for a full compilable program.
134
173
135
- ## Standard behavior
174
+ ### Standard behavior
136
175
137
176
The convenience method ` ConfigFactory.load() ` loads the following
138
177
(first-listed are higher priority):
@@ -183,7 +222,7 @@ configuration. In the replacement config file, you can use
183
222
file; after the include statement you could go on to override
184
223
certain settings.
185
224
186
- ## Merging config trees
225
+ ### Merging config trees
187
226
188
227
Any two Config objects can be merged with an associative operation
189
228
called ` withFallback ` , like ` merged = firstConfig.withFallback(secondConfig) ` .
@@ -209,7 +248,7 @@ Then you could code something like:
209
248
210
249
There are lots of ways to use ` withFallback ` .
211
250
212
- ## How to handle defaults
251
+ ### How to handle defaults
213
252
214
253
Many other configuration APIs allow you to provide a default to
215
254
the getter methods, like this:
@@ -304,7 +343,7 @@ Whatever you do, please remember not to cut-and-paste default
304
343
values into multiple places in your code. You have been warned!
305
344
:-)
306
345
307
- ## JSON Superset
346
+ ## Using HOCON, the JSON Superset
308
347
309
348
Tentatively called "Human-Optimized Config Object Notation" or
310
349
HOCON, also called ` .conf ` , see HOCON.md in this directory for more
@@ -534,7 +573,9 @@ Note: Play/Akka 2.0 have an earlier version that supports string
534
573
concatenation, but not object/array concatenation. ` += ` does not
535
574
work in Play/Akka 2.0 either.
536
575
537
- ## Debugging
576
+ ## Miscellaneous Notes
577
+
578
+ ### Debugging Your Configuration
538
579
539
580
If you have trouble with your configuration, some useful tips.
540
581
@@ -545,12 +586,12 @@ If you have trouble with your configuration, some useful tips.
545
586
- Use ` myConfig.root().render() ` to get a ` Config ` printed out as a
546
587
string with comments showing where each value came from.
547
588
548
- ## Java version
589
+ ### Java version
549
590
550
591
Currently the library is maintained against Java 6. It does not
551
592
build with Java 5.
552
593
553
- ## Rationale
594
+ ### Rationale for Supported File Formats
554
595
555
596
(For the curious.)
556
597
@@ -595,7 +636,7 @@ Two alternatives to HOCON syntax could be:
595
636
allow mixing true JSON files into the config but also support
596
637
a nicer format.
597
638
598
- ## Other APIs
639
+ ### Other APIs
599
640
600
641
This may not be comprehensive - if you'd like to add mention of
601
642
your wrapper, just send a pull request for this README. We would
0 commit comments