BoostedYAML
  • Overview
  • Getting Started
    • Implementation
    • Usage
    • Content manipulation
  • Routing
    • Routes
  • Settings
    • GeneralSettings
    • LoaderSettings
    • DumperSettings
    • UpdaterSettings
  • Serialization
    • Implementation
  • Updater
    • Updater
    • Document versioning system
      • Advanced topics
Powered by GitBook
On this page
  • Creating a builder
  • Basic settings
  • Create file if absent
  • Update automatically
  • Advanced settings
  • Error labels
  • Detailed errors
  • Allow duplicate keys
  • Max collection aliases
  • Tag constructors
  • Schema
  • Environment config
  1. Settings

LoaderSettings

Loader settings cover all options related explicitly (only) to file loading.

PreviousGeneralSettingsNextDumperSettings

Last updated 11 months ago

Creating a builder

Settings introduced by BoostedYAML follow builder design pattern, e.g. you may build your own settings using:

LoaderSettings.builder() /*configure*/ .build()

Basic settings

Create file if absent

Builder#setCreateFileIfAbsent(boolean createFileIfAbsent)

Sets if to create a new file and save it if it does not exist automatically.

Not effective if there is no file associated with the document.

Default: true (enabled)

Update automatically

Builder#setAutoUpdate(boolean autoUpdate)

If enabled, automatically calls after the document has been loaded.

Not effective if there are no defaults associated with the document.

Default: false (disabled)

Advanced settings

Error labels

Builder#setErrorLabel(@NotNull String label)

Sets custom label for error messages.

Detailed errors

Builder#setDetailedErrors(boolean detailedErrors)

Sets if to print detailed error messages.

Allow duplicate keys

Builder#setAllowDuplicateKeys(boolean allowDuplicateKeys)

Sets if to allow duplicate keys in sections (last key wins when loading).

Max collection aliases

Builder#setMaxCollectionAliases(int maxCollectionAliases)

Tag constructors

Builder#setTagConstructors(@NotNull Map<Tag, ConstructNode> constructors)

Sets custom node to Java object constructors, per YAML tag.

Schema

Builder#setSchema(@NotNull Schema schema)

Sets custom schema to use. Schemas are used to resolve and determine object tags contained within a document. This setting replaces setScalarResolver available until the 1.3.6 release.

Environment config

Builder#setEnvironmentConfig(@Nullable EnvConfig envConfig)

Sets custom environment variable config.

Default: defined by the parent method Parent method docs (v2.3): Related YAML spec (v1.2.2): -

Default: true Parent method docs (v2.3): Related YAML spec (v1.2.2): -

Default: true Parent method docs (v2.3): Related YAML spec (v1.2.2): -

Sets maximum aliases a collection can have to prevent memory leaks (see ).

Default: defined by the parent method Parent method docs (v2.3): Related YAML spec (v1.2.2): -

Default: defined by the parent method Parent method docs (v2.3): Related YAML spec (v1.2.2): ,

Default: defined by the parent method Parent method docs (v2.7): Related YAML spec (v1.2.2): ,

Default: defined by the parent method Parent method docs (v2.3): Related YAML spec (v1.2.2): -

click
click
click
Billion laughs attack
click
click
JSON schema tags
failsafe schema tags
click
JSON schema tags
failsafe schema tags
click
YamlFile#update()