-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ConfigDocumentFactory java.io.File methods from shared and put…
… in JvmNative
- Loading branch information
Showing
2 changed files
with
40 additions
and
33 deletions.
There are no files selected for viewing
39 changes: 38 additions & 1 deletion
39
...g/jvm-native/src/main/scala/org/ekrich/config/parser/ConfigDocumentFactoryJvmNative.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,44 @@ | ||
package org.ekrich.config.parser | ||
|
||
import java.io.File | ||
|
||
import org.ekrich.config.ConfigParseOptions | ||
import org.ekrich.config.impl.Parseable | ||
|
||
/** | ||
* [[ConfigFactoryDocument]] methods common to JVM and Native | ||
*/ | ||
abstract class ConfigDocumentFactoryJvmNative | ||
extends ConfigDocumentFactoryShared {} | ||
extends ConfigDocumentFactoryShared { | ||
|
||
/** | ||
* Parses a file into a ConfigDocument instance. | ||
* | ||
* @param file | ||
* the file to parse | ||
* @param options | ||
* parse options to control how the file is interpreted | ||
* @return | ||
* the parsed configuration | ||
* @throws org.ekrich.config.ConfigException | ||
* on IO or parse errors | ||
*/ | ||
def parseFile(file: File, options: ConfigParseOptions): ConfigDocument = | ||
Parseable.newFile(file, options).parseConfigDocument() | ||
|
||
/** | ||
* Parses a file into a ConfigDocument instance as with | ||
* [[#parseFile(file:java\.io\.File,options:org\.ekrich\.config\.ConfigParseOptions)* parseFile(File, ConfigParseOptions)]] | ||
* but always uses the default parse options. | ||
* | ||
* @param file | ||
* the file to parse | ||
* @return | ||
* the parsed configuration | ||
* @throws org.ekrich.config.ConfigException | ||
* on IO or parse errors | ||
*/ | ||
def parseFile(file: File): ConfigDocument = | ||
parseFile(file, ConfigParseOptions.defaults) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters