laika.config
Members list
Type members
Classlikes
A value containing an AST element obtained from text markup or templates.
A value containing an AST element obtained from text markup or templates.
Such a value can be used in scenarios where substitution variables in templates or markup want to refer to other AST elements and include them into their AST tree as is.
Attributes
- Supertypes
-
trait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait SimpleConfigValuetrait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
API for retrieving configuration values based on a string key and a decoder.
API for retrieving configuration values based on a string key and a decoder.
Config instances are used in many places in this library, each Document
, DocumentTree
and Directive
has a Config instance associated with it.
One use case for configuration is controlling the behaviour of built-in features, like setting the navigation order or the depth for table of contents.
A second use case is user configuration, where custom variables can be set in configuration files or headers and then referenced in templates or markup with the syntax ${ref.path}
.
The key is a path separated by '.', which allows to reference nested objects in the configuration.
Built-in decoders are available for simple types like String
, Int
, Double
, Boolean
and any Seq
consisting of those values.
It also comes with a decoder for Path
, which resolves relative paths in the configuration against the (virtual) path of the origin.
This API is usually used with values obtained by parsing HOCON, as specified in https://github.com/lightbend/config/blob/master/HOCON.md, but the API is generic and can also be used with values specified programmatically.
Please note that Laika does not depend on the Typesafe Config library or any of its commonly used Scala wrappers or forks. It has its own HOCON parser, which implements the full spec while still being minimal and lightweight. It also ensures the FP properties are kept intact, e.g. it has full referential transparency and does not throw Exceptions like most of the alternatives.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object EmptyConfig.typeclass ObjectConfig
A builder for creating a Config instance programmatically.
A builder for creating a Config instance programmatically.
While it's most common in Laika that Config instances are obtained by parsing HOCON, instances can also be created entirely programmatically, or by a combination of HOCON and programmatic values if an existing fallback is used with builder.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Companion factory for ConfigBuilder instances.
Companion factory for ConfigBuilder instances.
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ConfigBuilder.type
A type class that can decode a ConfigValue to an instance of T.
A type class that can decode a ConfigValue to an instance of T.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Companion containing default decoder implementations for simple values and Seq's.
Companion containing default decoder implementations for simple values and Seq's.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ConfigDecoder.type
A type class that can encode a value of type T as a ConfigValue.
A type class that can encode a value of type T as a ConfigValue.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Companion containing default encoder implementations for simple values and Seq's.
Companion containing default encoder implementations for simple values and Seq's.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ConfigEncoder.type
Base trait for all configuration errors that occurred during parsing, resolving, retrieving or convering configuration values.
Base trait for all configuration errors that occurred during parsing, resolving, retrieving or convering configuration values.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ConfigErrorsclass ConfigParserErrorclass ConfigParserErrorsclass ConfigResolverErrorclass ConfigResourceErrorclass DecodingErrorclass DocumentConfigErrorsclass InvalidTypeclass NotFoundclass TreeConfigErrorsclass ValidationErrorShow all
Multiple errors that occurred when processing configuration.
Multiple errors that occurred when processing configuration.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
A ConfigError as a RuntimeException for use cases where a Throwable is required.
A ConfigError as a RuntimeException for use cases where a Throwable is required.
Attributes
- Supertypes
-
trait Producttrait Equalsclass RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
A parser for obtaining a Config instance from a HOCON string.
A parser for obtaining a Config instance from a HOCON string.
The HOCON format expected by this parsers is specified at https://github.com/lightbend/config/blob/master/HOCON.md
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ConfigParser.type
An error that occurred when parsing HOCON input.
An error that occurred when parsing HOCON input.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
Multiple errors that occurred when parsing HOCON input.
Multiple errors that occurred when parsing HOCON input.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
An error that occurred when resolving the interim result of a parsing operation.
An error that occurred when resolving the interim result of a parsing operation.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
An error that occurred when loading a resource, before parsing could start.
An error that occurred when loading a resource, before parsing could start.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
The base trait for all configuration values.
The base trait for all configuration values.
This data structure is quite similar to those found in common JSON libraries (HOCON is a JSON superset after all).
The only exception is one special type: the ASTValue
which can hold an instance of a document AST obtained from parsing text markup.
This can be useful in scenarios where substitution variables in templates or markup want to refer to other AST elements and include them into their AST tree as is.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class ASTValueclass ArrayValueclass ObjectValuetrait SimpleConfigValueclass BooleanValueclass DoubleValueclass LongValueobject NullValue.typeclass StringValueShow all
An error that occurred when decoding a configuration value to a target type.
An error that occurred when decoding a configuration value to a target type.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
A defaultKey can be used for commonly used configuration objects like AutonumberConfig
that are expected to be mapped to a specific key, like autonumbering
without requiring the user to remember these keys.
A defaultKey can be used for commonly used configuration objects like AutonumberConfig
that are expected to be mapped to a specific key, like autonumbering
without requiring the user to remember these keys.
val config: Config = ???
val res: ConfigResult[AutonumberConfig] = config.get[AutonumberConfig]
In the example above retrieval happens solely based on the type of the result with the associated key being specified by an implicit DefaultKey
.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DefaultKey.type
Multiple errors that occurred when processing configuration for a document.
Multiple errors that occurred when processing configuration for a document.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
DocumentConfigErrors.type
Attributes
- Supertypes
-
trait SimpleConfigValuetrait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
An empty configuration instance.
A single field of an object value.
A single field of an object value.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Indicates that a value found in the configuration does not have the expected type so that type conversion is not even attempted.
Indicates that a value found in the configuration does not have the expected type so that type conversion is not even attempted.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Constants for configuration keys for the library's core configuration entries.
Constants for configuration keys for the library's core configuration entries.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LaikaKeys.type
Attributes
- Supertypes
-
trait SimpleConfigValuetrait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A required value that could not be found.
A required value that could not be found.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait SimpleConfigValuetrait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
NullValue.type
The default implementation of the Config API.
The default implementation of the Config API.
Attributes
- Supertypes
Attributes
- Supertypes
-
trait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The origin of a configuration value.
The origin of a configuration value.
Origins can be used to distinguish values from a specific Config instance from those which were inherited from a fallback, which might be relevant in scenarios where relative paths need to be resolved.
Value parameters
- path
-
the virtual path of containing config instance in a document tree (not the key inside the configuration)
- scope
-
the scope of the containing config instance
- sourcePath
-
the path in the file system this configuration originates from, empty if it was constructed in memory
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Base trait for all simple configuration values.
Base trait for all simple configuration values.
Attributes
- Supertypes
-
trait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
Attributes
- Supertypes
-
trait SimpleConfigValuetrait ConfigValuetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A value tagged with its origin.
A value tagged with its origin.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Multiple errors that occurred when processing configuration for a document tree.
Multiple errors that occurred when processing configuration for a document tree.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all
A generic error for invalid values.
A generic error for invalid values.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait ConfigErrorclass Objecttrait Matchableclass AnyShow all