Top Description Methods
com.typesafe.config

public Interface ConfigIncluder

Known Direct Subinterfaces
com.typesafe.config.impl.FullIncluder

Implement this interface and provide an instance to ConfigParseOptions.setIncluder() to customize handling of include statements in config files. You may also want to implement ConfigIncluderClasspath, ConfigIncluderFile, and ConfigIncluderURL, or not.

Method Summary

Modifier and TypeMethod and Description
public ConfigObject

Returns:

a non-null ConfigObject
include
(ConfigIncludeContext
some info about the include context
context
,
String
the include statement's argument
what
)

Parses another item to be included.

public ConfigIncluder

Returns:

a new includer
withFallback
(ConfigIncluder
the previous includer for chaining
fallback
)

Returns a new includer that falls back to the given includer.

Method Detail

includeback to summary
public ConfigObject include(ConfigIncludeContext context, String what)

Parses another item to be included. The returned object typically would not have substitutions resolved. You can throw a ConfigException here to abort parsing, or return an empty object, but may not return null. This method is used for a "heuristic" include statement that does not specify file, URL, or classpath resource. If the include statement does specify, then the same class implementing ConfigIncluder must also implement ConfigIncluderClasspath, ConfigIncluderFile, or ConfigIncluderURL as needed, or a default includer will be used.

Parameters
context:ConfigIncludeContext

some info about the include context

what:String

the include statement's argument

Returns:ConfigObject

a non-null ConfigObject

withFallbackback to summary
public ConfigIncluder withFallback(ConfigIncluder fallback)

Returns a new includer that falls back to the given includer. This is how you can obtain the default includer; it will be provided as a fallback. It's up to your includer to chain to it if you want to. You might want to merge any files found by the fallback includer with any objects you load yourself. It's important to handle the case where you already have the fallback with a "return this", i.e. this method should not create a new object if the fallback is the same one you already have. The same fallback may be added repeatedly.

Parameters
fallback:ConfigIncluder

the previous includer for chaining

Returns:ConfigIncluder

a new includer