-
-
Notifications
You must be signed in to change notification settings - Fork 67
Loaders
Loaders handle serializing a ConfigurationNode structure to or from a target, providing load and save operations for any node.
Loaders are created using builders, which allow setting options on a then-immutable configuration loader.
Builders accept Callable<BufferedReader>
s and Callable<BufferedWriter>
s as factories to provide the streams used to read and write configurations.
Format: YAML
Artifact ID: configurate-yaml
- Indent: How many spaces wide an indentation level should be
- Node style: Block, Flow, or have the yaml library pick. These flow styles are defined in the YAML spec
Format: HOCON
Artifact ID: configurate-hocon
This format is capable of both reading and writing comments that are placed before the node they refer to.
Unfortunately due to limitations in the underlying library, the MapFactory
provided by the ConfigurationOptions
used in nodes is not respected. This means the output order of nodes is uncertain.
The HoconConfigurationLoader's builder exposes ConfigParseOptions and ConfigRenderOptions from the Hocon library which can be modified as desired.
Format: JSON
Artifact ID: configurate-jackson
This is an alternative JSON parser. It supports streaming loading.
- The JsonFactory is exposed in the builder to set features on
- indent is configurable
- the spacing style of field key-value separators is configurable
Format: JSON
Artifact ID: configurate-gson
- indent: number of spaces wide an indent should be
- lenient: whether the parser should handle processes leniently
Format: XML
Artifact ID: configurate-xml
As of Configurate 3.7, this serializer will support round-tripping comments within the document.
-
schema: A
javax.xml.validation.Schema
instance to validate loaded documents against. - defaultTagName: A name for tags for items in a list.
- indent: The amount of spaces to indent for each level of indentation.
-
writeExplicitType: Explicitly write
configurate-type
attributes to map and list values. - includeXmlDeclaration: Whether to include the XML declaration in written files.