public abstract class AbstractConfiguration extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_FNAME
Name of the default configuration file with extension (no path).
|
static String |
DEFAULT_NAME
Just the name of the default configuration file, no extension, no path.
|
| Constructor and Description |
|---|
AbstractConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
static <C> C |
readFromYaml(Class<C> cls)
Reads a configurationfrom
DEFAULT_FNAME in the root folder of the JAR/classpath. |
static <C> C |
readFromYaml(Class<C> cls,
InputStream in)
Reads a instance from
in. |
static <C> C |
readFromYaml(Class<C> cls,
String filename)
Reads a configuration from the root folder of the JAR/classpath.
|
public static final String DEFAULT_NAME
public static final String DEFAULT_FNAME
public static <C> C readFromYaml(Class<C> cls) throws IOException
DEFAULT_FNAME in the root folder of the JAR/classpath. Unknown properties
are ignored.C - the specific type of configuration to readcls - the class of configuration to readIOException - if the file cannot be read/found, the configuration class cannot be instantiatedpublic static <C> C readFromYaml(Class<C> cls, String filename) throws IOException
C - the specific type of configuration to readcls - the class of configuration to readfilename - the filename (a leading "/" is added if missing for JAR/classpath resource access)IOException - if the file cannot be read/found, the configuration class cannot be instantiatedpublic static <C> C readFromYaml(Class<C> cls, InputStream in) throws IOException
in. Unknown properties are ignored.C - the specific type of configuration to readcls - the class of configuration to readin - the stream to read from (ignored if null)IOException - if the data cannot be read, the configuration class cannot be instantiatedCopyright © 2021. All rights reserved.