|
1 | 1 | package org.ekrich.config.parser
|
2 | 2 |
|
3 |
| -import org.ekrich.config.ConfigParseOptions |
4 |
| -import org.ekrich.config.impl.Parseable |
5 |
| -import java.io.File |
6 |
| -import java.io.Reader |
7 |
| - |
8 | 3 | /**
|
9 | 4 | * Factory for creating [[org.ekrich.config.parser.ConfigDocument]] instances.
|
10 | 5 | */
|
11 |
| -object ConfigDocumentFactory { |
12 |
| - |
13 |
| - /** |
14 |
| - * Parses a Reader into a ConfigDocument instance. |
15 |
| - * |
16 |
| - * @param reader |
17 |
| - * the reader to parse |
18 |
| - * @param options |
19 |
| - * parse options to control how the reader is interpreted |
20 |
| - * @return |
21 |
| - * the parsed configuration |
22 |
| - * @throws ConfigException |
23 |
| - * on IO or parse errors |
24 |
| - */ |
25 |
| - def parseReader(reader: Reader, options: ConfigParseOptions): ConfigDocument = |
26 |
| - Parseable.newReader(reader, options).parseConfigDocument() |
27 |
| - |
28 |
| - /** |
29 |
| - * Parses a reader into a Config instance as with |
30 |
| - * [[#parseReader(reader:java\.io\.Reader,options:org\.ekrich\.config\.ConfigParseOptions)* parseReader(Reader, ConfigParseOptions)]] |
31 |
| - * but always uses the default parse options. |
32 |
| - * |
33 |
| - * @param reader |
34 |
| - * the reader to parse |
35 |
| - * @return |
36 |
| - * the parsed configuration |
37 |
| - * @throws org.ekrich.config.ConfigException |
38 |
| - * on IO or parse errors |
39 |
| - */ |
40 |
| - def parseReader(reader: Reader): ConfigDocument = |
41 |
| - parseReader(reader, ConfigParseOptions.defaults) |
42 |
| - |
43 |
| - /** |
44 |
| - * Parses a file into a ConfigDocument instance. |
45 |
| - * |
46 |
| - * @param file |
47 |
| - * the file to parse |
48 |
| - * @param options |
49 |
| - * parse options to control how the file is interpreted |
50 |
| - * @return |
51 |
| - * the parsed configuration |
52 |
| - * @throws org.ekrich.config.ConfigException |
53 |
| - * on IO or parse errors |
54 |
| - */ |
55 |
| - def parseFile(file: File, options: ConfigParseOptions): ConfigDocument = |
56 |
| - Parseable.newFile(file, options).parseConfigDocument() |
57 |
| - |
58 |
| - /** |
59 |
| - * Parses a file into a ConfigDocument instance as with |
60 |
| - * [[#parseFile(file:java\.io\.File,options:org\.ekrich\.config\.ConfigParseOptions)* parseFile(File, ConfigParseOptions)]] |
61 |
| - * but always uses the default parse options. |
62 |
| - * |
63 |
| - * @param file |
64 |
| - * the file to parse |
65 |
| - * @return |
66 |
| - * the parsed configuration |
67 |
| - * @throws org.ekrich.config.ConfigException |
68 |
| - * on IO or parse errors |
69 |
| - */ |
70 |
| - def parseFile(file: File): ConfigDocument = |
71 |
| - parseFile(file, ConfigParseOptions.defaults) |
72 |
| - |
73 |
| - /** |
74 |
| - * Parses a string which should be valid HOCON or JSON. |
75 |
| - * |
76 |
| - * @param s |
77 |
| - * string to parse |
78 |
| - * @param options |
79 |
| - * parse options |
80 |
| - * @return |
81 |
| - * the parsed configuration |
82 |
| - */ |
83 |
| - def parseString(s: String, options: ConfigParseOptions): ConfigDocument = |
84 |
| - Parseable.newString(s, options).parseConfigDocument() |
85 |
| - |
86 |
| - /** |
87 |
| - * Parses a string (which should be valid HOCON or JSON). Uses the default |
88 |
| - * parse options. |
89 |
| - * |
90 |
| - * @param s |
91 |
| - * string to parse |
92 |
| - * @return |
93 |
| - * the parsed configuration |
94 |
| - */ |
95 |
| - def parseString(s: String): ConfigDocument = |
96 |
| - parseString(s, ConfigParseOptions.defaults) |
97 |
| -} |
| 6 | +object ConfigDocumentFactory extends PlatformConfigDocumentFactory {} |
0 commit comments