Package com.typesafe.config.parser
Class ConfigDocumentFactory
java.lang.Object
com.typesafe.config.parser.ConfigDocumentFactory
Factory for creating
ConfigDocument
instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigDocument
Parses a file into a ConfigDocument instance as withparseFile(File,ConfigParseOptions)
but always uses the default parse options.static ConfigDocument
parseFile
(File file, ConfigParseOptions options) Parses a file into a ConfigDocument instance.static ConfigDocument
parseReader
(Reader reader) Parses a reader into a Config instance as withparseReader(Reader,ConfigParseOptions)
but always uses the default parse options.static ConfigDocument
parseReader
(Reader reader, ConfigParseOptions options) Parses a Reader into a ConfigDocument instance.static ConfigDocument
Parses a string (which should be valid HOCON or JSON).static ConfigDocument
parseString
(String s, ConfigParseOptions options) Parses a string which should be valid HOCON or JSON.
-
Constructor Details
-
ConfigDocumentFactory
public ConfigDocumentFactory()
-
-
Method Details
-
parseReader
Parses a Reader into a ConfigDocument instance.- Parameters:
reader
- the reader to parseoptions
- parse options to control how the reader is interpreted- Returns:
- the parsed configuration
- Throws:
ConfigException
- on IO or parse errors
-
parseReader
Parses a reader into a Config instance as withparseReader(Reader,ConfigParseOptions)
but always uses the default parse options.- Parameters:
reader
- the reader to parse- Returns:
- the parsed configuration
- Throws:
ConfigException
- on IO or parse errors
-
parseFile
Parses a file into a ConfigDocument instance.- Parameters:
file
- the file to parseoptions
- parse options to control how the file is interpreted- Returns:
- the parsed configuration
- Throws:
ConfigException
- on IO or parse errors
-
parseFile
Parses a file into a ConfigDocument instance as withparseFile(File,ConfigParseOptions)
but always uses the default parse options.- Parameters:
file
- the file to parse- Returns:
- the parsed configuration
- Throws:
ConfigException
- on IO or parse errors
-
parseString
Parses a string which should be valid HOCON or JSON.- Parameters:
s
- string to parseoptions
- parse options- Returns:
- the parsed configuration
-
parseString
Parses a string (which should be valid HOCON or JSON). Uses the default parse options.- Parameters:
s
- string to parse- Returns:
- the parsed configuration
-