Package com.typesafe.config.parser

# Class ConfigDocumentFactory

java.lang.Object
com.typesafe.config.parser.ConfigDocumentFactory

public final class ConfigDocumentFactory extends Object
Factory for creating `ConfigDocument` instances.

## Constructor Summary

Constructors
Constructor
Description
`ConfigDocumentFactory()`

## Method Summary

Modifier and Type
Method
Description
`static ConfigDocument`
`parseFile(File file)`
Parses a file into a ConfigDocument instance as with `parseFile(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 with `parseReader(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`
`parseString(String s)`
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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ConfigDocumentFactory

public ConfigDocumentFactory()

## Method Details

### parseReader

public static ConfigDocument parseReader(Reader reader, ConfigParseOptions options)
Parses a Reader into a ConfigDocument instance.

Parameters:
  `reader` - the reader to parse
  `options` - parse options to control how the reader is interpreted
Returns:
  the parsed configuration
Throws:
  `ConfigException` - on IO or parse errors

### parseReader

public static ConfigDocument parseReader(Reader reader)
Parses a reader into a Config instance as with `parseReader(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

public static ConfigDocument parseFile(File file, ConfigParseOptions options)
Parses a file into a ConfigDocument instance.

Parameters:
  `file` - the file to parse
  `options` - parse options to control how the file is interpreted
Returns:
  the parsed configuration
Throws:
  `ConfigException` - on IO or parse errors

### parseFile

public static ConfigDocument parseFile(File file)
Parses a file into a ConfigDocument instance as with `parseFile(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

public static ConfigDocument parseString(String s, ConfigParseOptions options)
Parses a string which should be valid HOCON or JSON.

Parameters:
  `s` - string to parse
  `options` - parse options
Returns:
  the parsed configuration

### parseString

public static ConfigDocument parseString(String s)
Parses a string (which should be valid HOCON or JSON). Uses the default parse options.

Parameters:
  `s` - string to parse
Returns:
  the parsed configuration