T
- the type of configuration this factory creates.public abstract class AbstractConfigFactory<T extends AbstractConfig>
extends java.lang.Object
Constructor and Description |
---|
AbstractConfigFactory() |
Modifier and Type | Method and Description |
---|---|
T |
fromFile(java.io.File file)
Parses a configuration object given as JSON file.
|
T |
fromFilePath(java.lang.String path)
Parses a configuration object given as path to a JSON file.
|
T |
fromInputStream(java.io.InputStream is)
same as
fromInputStream(InputStream, String) , but with null passed as parentPath |
T |
fromInputStream(java.io.InputStream is,
java.lang.String parentPath)
Parses a configuration object given an input stream.
|
T |
fromJson(java.lang.String json)
Same as
fromJson(String, String) , but with null passed as parentPath. |
T |
fromJson(java.lang.String json,
java.lang.String parentPath)
Parses a configuration object given a JSON string.
|
T |
fromPath(java.lang.String path)
Parses a configuration object given a path.
|
T |
fromProperties(java.io.InputStream is)
same as
fromProperties(Properties) , but instantiates a new Properties object from the given
InputStream . |
abstract T |
fromProperties(java.util.Properties props)
Parses a configuration object from
Properties . |
public final T fromFile(java.io.File file) throws java.io.IOException
file
- the input filejava.io.IOException
- if there was any I/O error during reading given filepublic final T fromFilePath(java.lang.String path) throws java.io.IOException
path
- the path to the JSON filejava.io.IOException
- if there was any I/O error during reading given filepublic final T fromInputStream(java.io.InputStream is) throws java.io.IOException
fromInputStream(InputStream, String)
, but with null
passed as parentPathis
- the input stream from where to read the configurationjava.io.IOException
- if there was any I/O error during reading given input streampublic final T fromInputStream(java.io.InputStream is, java.lang.String parentPath) throws java.io.IOException
is
- the input stream from where to read the configurationparentPath
- if not null
, relative paths found in config will resolved against this parentPathjava.io.IOException
- if there was any I/O error during reading given input streampublic final T fromJson(java.lang.String json) throws java.io.IOException
fromJson(String, String)
, but with null
passed as parentPath.json
- the input JSON stringjava.io.IOException
- if there was any I/O error during reading given JSON stringpublic final T fromJson(java.lang.String json, java.lang.String parentPath) throws java.io.IOException
json
- the input JSON stringparentPath
- if not null
, relative paths found in config will resolved against this parentPathjava.io.IOException
- if there was any I/O error during reading given JSON stringpublic final T fromPath(java.lang.String path) throws java.io.IOException
path
- the path from where to parse the configurationjava.io.IOException
- if there was any I/O error during reading given pathpublic final T fromProperties(java.io.InputStream is) throws java.io.IOException
fromProperties(Properties)
, but instantiates a new Properties
object from the given
InputStream
.is
- the input stream containing configuration in Properties
format.java.io.IOException
- if there was any I/O error during reading given input streampublic abstract T fromProperties(java.util.Properties props)
Properties
.props
- the input propertiesCopyright © 2015 - 2020 Oracle and/or its affiliates. All Rights Reserved.