Class JsonConfigOptions

java.lang.Object
dev.orne.config.impl.JsonConfigOptions
Direct Known Subclasses:
YamlConfigOptions

@API(status=INTERNAL, since="1.0") public class JsonConfigOptions extends Object
Options of Jackson ObjectNode based configuration builder.
Since:
1.0
Version:
1.0, 2025-07
Author:
(w) Iker Hernaez
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor.
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(@NotNull com.fasterxml.jackson.databind.node.ObjectNode values)
    Adds the specified configuration properties to the configuration properties.
    @NotNull com.fasterxml.jackson.databind.node.ObjectNode
    Returns the JSON object with the configuration properties.
    @NotNull com.fasterxml.jackson.databind.ObjectMapper
    Returns the ObjectMapper instance used for JSON parsing.
    @NotEmpty String
    Returns the configuration nested properties separator.
    void
    load(@NotNull File file)
    Loads the configuration properties from the specified file.
    void
    load(@NotNull String path)
    Loads the configuration properties from the specified ClassLoader resource.
    void
    load(@NotNull URL url)
    Loads the configuration properties from the specified URL.
    void
    load(@NotNull Path path)
    Loads the configuration properties from the file in the specified path.
    void
    setMapper(@NotNull com.fasterxml.jackson.databind.ObjectMapper mapper)
    Sets the ObjectMapper instance used for JSON parsing.
    void
    setPropertySeparator(@NotEmpty String separator)
    Sets the configuration nested properties separator.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JsonConfigOptions

      public JsonConfigOptions()
      Empty constructor.
    • JsonConfigOptions

      public JsonConfigOptions(@NotNull @NotNull JsonConfigOptions copy)
      Copy constructor.
      Parameters:
      copy - The instance to copy.
  • Method Details

    • getMapper

      @NotNull public @NotNull com.fasterxml.jackson.databind.ObjectMapper getMapper()
      Returns the ObjectMapper instance used for JSON parsing.
      Returns:
      The ObjectMapper instance used for JSON parsing.
    • setMapper

      public void setMapper(@NotNull @NotNull com.fasterxml.jackson.databind.ObjectMapper mapper)
      Sets the ObjectMapper instance used for JSON parsing.
      Parameters:
      mapper - The ObjectMapper instance used for JSON parsing.
    • getJsonObject

      @NotNull public @NotNull com.fasterxml.jackson.databind.node.ObjectNode getJsonObject()
      Returns the JSON object with the configuration properties.
      Returns:
      The JSON object with the configuration properties.
    • getPropertySeparator

      @NotEmpty public @NotEmpty String getPropertySeparator()
      Returns the configuration nested properties separator.
      Returns:
      The configuration nested properties separator.
    • setPropertySeparator

      public void setPropertySeparator(@NotEmpty @NotEmpty String separator)
      Sets the configuration nested properties separator.
      Parameters:
      separator - The configuration nested properties separator.
    • add

      public void add(@NotNull @NotNull com.fasterxml.jackson.databind.node.ObjectNode values)
      Adds the specified configuration properties to the configuration properties.
      Parameters:
      values - The configuration properties.
    • load

      public void load(@NotNull @NotNull String path)
      Loads the configuration properties from the specified ClassLoader resource.
      Parameters:
      path - The ClassLoader resource path.
    • load

      public void load(@NotNull @NotNull Path path)
      Loads the configuration properties from the file in the specified path.
      Parameters:
      path - The file path.
    • load

      public void load(@NotNull @NotNull File file)
      Loads the configuration properties from the specified file.
      Parameters:
      file - The file to load.
    • load

      public void load(@NotNull @NotNull URL url)
      Loads the configuration properties from the specified URL.
      Parameters:
      url - The URL to load.