public final class ConfigParseOptions
extends java.lang.Object
This object is immutable, so the "setters" return a new object.
Here is an example of creating a custom ConfigParseOptions
:
ConfigParseOptions options = ConfigParseOptions.defaults() .setSyntax(ConfigSyntax.JSON) .setAllowMissing(false)
Modifier and Type | Method | Description |
---|---|---|
ConfigParseOptions |
appendIncluder(ConfigIncluder includer) |
|
static ConfigParseOptions |
defaults() |
|
boolean |
getAllowMissing() |
|
java.lang.ClassLoader |
getClassLoader() |
Get the class loader; never returns
null , if the class loader was
unset, returns
Thread.currentThread().getContextClassLoader() . |
ConfigIncluder |
getIncluder() |
|
java.lang.String |
getOriginDescription() |
|
ConfigSyntax |
getSyntax() |
|
ConfigParseOptions |
prependIncluder(ConfigIncluder includer) |
|
ConfigParseOptions |
setAllowMissing(boolean allowMissing) |
Set to false to throw an exception if the item being parsed (for example
a file) is missing.
|
ConfigParseOptions |
setClassLoader(java.lang.ClassLoader loader) |
Set the class loader.
|
ConfigParseOptions |
setIncluder(ConfigIncluder includer) |
Set a ConfigIncluder which customizes how includes are handled.
|
ConfigParseOptions |
setOriginDescription(java.lang.String originDescription) |
Set a description for the thing being parsed.
|
ConfigParseOptions |
setSyntax(ConfigSyntax syntax) |
Set the file format.
|
public static ConfigParseOptions defaults()
public ConfigParseOptions setSyntax(ConfigSyntax syntax)
ConfigSyntax.CONF
.syntax
- a syntax or null
for best guesspublic ConfigSyntax getSyntax()
public ConfigParseOptions setOriginDescription(java.lang.String originDescription)
ConfigOrigin
of the parsed values.originDescription
- public java.lang.String getOriginDescription()
public ConfigParseOptions setAllowMissing(boolean allowMissing)
allowMissing
- public boolean getAllowMissing()
public ConfigParseOptions setIncluder(ConfigIncluder includer)
includer
- public ConfigParseOptions prependIncluder(ConfigIncluder includer)
public ConfigParseOptions appendIncluder(ConfigIncluder includer)
public ConfigIncluder getIncluder()
public ConfigParseOptions setClassLoader(java.lang.ClassLoader loader)
Thread.currentThread().getContextClassLoader()
will be used.loader
- a class loader or null
to use thread context class
loaderpublic java.lang.ClassLoader getClassLoader()
null
, if the class loader was
unset, returns
Thread.currentThread().getContextClassLoader()
.