copy Copy chevron-down
Settings LoaderSettings Loader settings cover all options related explicitly (only) to file loading.
Creating a builder
Settings introduced by BoostedYAML follow builder design pattern, e.g. you may build your own settings using:
Copy LoaderSettings . builder () /* configure */ . build () Create file if absent
Copy Builder# setCreateFileIfAbsent ( boolean createFileIfAbsent ) Sets if to create a new file and save it if it does not exist automatically.
circle-exclamation
Not effective if there is no file associated with the document.
Default: true (enabled)
Update automatically
Copy Builder# setAutoUpdate ( boolean autoUpdate ) If enabled, automatically calls YamlFile#update() after the document has been loaded.
circle-exclamation
Not effective if there are no defaults associated with the document.
Default: false (disabled)
Advanced settings
Sets custom label for error messages.
Default: defined by the parent method
Parent method docs (v2.3): clickarrow-up-right
Related YAML spec (v1.2.2): -
Detailed errors
Sets if to print detailed error messages.
Default: true
Parent method docs (v2.3): clickarrow-up-right
Related YAML spec (v1.2.2): -
Allow duplicate keys
Sets if to allow duplicate keys in sections (last key wins when loading).
Default: true
Parent method docs (v2.3): clickarrow-up-right
Related YAML spec (v1.2.2): -
Max collection aliases
Sets maximum aliases a collection can have to prevent memory leaks (see Billion laughs attackarrow-up-right ).
Default: defined by the parent method
Parent method docs (v2.3): clickarrow-up-right
Related YAML spec (v1.2.2): -
Tag constructors
Sets custom node to Java object constructors, per YAML tag.
Default: defined by the parent method
Parent method docs (v2.3): clickarrow-up-right
Related YAML spec (v1.2.2): JSON schema tagsarrow-up-right , failsafe schema tagsarrow-up-right
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.
Default: defined by the parent method
Parent method docs (v2.7): clickarrow-up-right
Related YAML spec (v1.2.2): JSON schema tagsarrow-up-right , failsafe schema tagsarrow-up-right
Environment config
Sets custom environment variable config.
Default: defined by the parent method
Parent method docs (v2.3): clickarrow-up-right
Related YAML spec (v1.2.2): -