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 | Field and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv final ClassLoader | |
| pack-priv final ConfigIncluder | |
| pack-priv final String | |
| pack-priv final ConfigSyntax |
| Access | Constructor and Description |
|---|---|
| private | ConfigParseOptions(ConfigSyntax syntax, String originDescription, boolean allowMissing, ConfigIncluder includer, ClassLoader classLoader)
|
| Modifier and Type | Method and Description |
|---|---|
| public ConfigParseOptions | Returns: new version of the parse options with different includerthe includer to append (may not be null) includer)Appends a |
| public static ConfigParseOptions | Returns: the default parse optionsGets an instance of |
| public boolean | |
| public ClassLoader | Returns: class loader to useGet the class loader; never returns |
| public ConfigIncluder | Returns: current includer or nullGets the current includer (will be null for the default includer). |
| public String | Returns: the current origin description or nullGets the current origin description, which may be null for "automatic". |
| public ConfigSyntax | Returns: the current syntax or nullGets the current syntax option, which may be null for "any". |
| public ConfigParseOptions | Returns: new version of the parse options with different includerthe includer to prepend (may not be null) includer)Prepends a |
| public ConfigParseOptions | Returns: options with the "allow missing" flag settrue to silently ignore missing item allowMissing)Set to false to throw an exception if the item being parsed (for example a file) is missing. |
| public ConfigParseOptions | Returns: options with the class loader seta class loader or loader)null to use thread context class
loaderSet the class loader. |
| public ConfigParseOptions | Returns: new version of the parse options with different includerthe includer to use or null for default includer)Set a |
| public ConfigParseOptions | Returns: options with the origin description setdescription to put in the originDescription)ConfigOriginSet a description for the thing being parsed. |
| public ConfigParseOptions | Returns: options with the syntax seta syntax or syntax)null for best guessSet the file format. |
| public ConfigParseOptions | Returns: options with the syntax seta configuration file name filename)Set the file format. |
| pack-priv ConfigParseOptions |
| allowMissing | back to summary |
|---|---|
| pack-priv final boolean allowMissing | |
| classLoader | back to summary |
|---|---|
| pack-priv final ClassLoader classLoader | |
| includer | back to summary |
|---|---|
| pack-priv final ConfigIncluder includer | |
| originDescription | back to summary |
|---|---|
| pack-priv final String originDescription | |
| syntax | back to summary |
|---|---|
| pack-priv final ConfigSyntax syntax | |
| ConfigParseOptions | back to summary |
|---|---|
| private ConfigParseOptions(ConfigSyntax syntax, String originDescription, boolean allowMissing, ConfigIncluder includer, ClassLoader classLoader) | |
| appendIncluder | back to summary |
|---|---|
| public ConfigParseOptions appendIncluder(ConfigIncluder includer) Appends a
| |
| defaults | back to summary |
|---|---|
| public static ConfigParseOptions defaults() Gets an instance of
| |
| getAllowMissing | back to summary |
|---|---|
| public boolean getAllowMissing() Gets the current "allow missing" flag.
| |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() Get the class loader; never returns
| |
| getIncluder | back to summary |
|---|---|
| public ConfigIncluder getIncluder() Gets the current includer (will be null for the default includer).
| |
| getOriginDescription | back to summary |
|---|---|
| public String getOriginDescription() Gets the current origin description, which may be null for "automatic".
| |
| getSyntax | back to summary |
|---|---|
| public ConfigSyntax getSyntax() Gets the current syntax option, which may be null for "any".
| |
| prependIncluder | back to summary |
|---|---|
| public ConfigParseOptions prependIncluder(ConfigIncluder includer) Prepends a
| |
| setAllowMissing | back to summary |
|---|---|
| public ConfigParseOptions setAllowMissing(boolean allowMissing) Set to false to throw an exception if the item being parsed (for example a file) is missing. Set to true to just return an empty document in that case. Note that this setting applies on only to fetching the root document, it has no effect on any nested includes.
| |
| setClassLoader | back to summary |
|---|---|
| public ConfigParseOptions setClassLoader(ClassLoader loader) Set the class loader. If set to null,
| |
| setIncluder | back to summary |
|---|---|
| public ConfigParseOptions setIncluder(ConfigIncluder includer) Set a
| |
| setOriginDescription | back to summary |
|---|---|
| public ConfigParseOptions setOriginDescription(String originDescription) Set a description for the thing being parsed. In most cases this will be
set up for you to something like the filename, but if you provide just an
input stream you might want to improve on it. Set to null to allow the
library to come up with something automatically. This description is the
basis for the
| |
| setSyntax | back to summary |
|---|---|
| public ConfigParseOptions setSyntax(ConfigSyntax syntax) Set the file format. If set to null, try to guess from any available
filename extension; if guessing fails, assume
| |
| setSyntaxFromFilename | back to summary |
|---|---|
| public ConfigParseOptions setSyntaxFromFilename(String filename) Set the file format. If set to null, assume
| |
| withFallbackOriginDescription | back to summary |
|---|---|
| pack-priv ConfigParseOptions withFallbackOriginDescription(String originDescription) this is package-private, not public API | |