Class JsonContext

java.lang.Object
org.eclipse.parsson.JsonContext

final class JsonContext extends Object
Parsson configuration. Values are composed from properties Map, system properties and default value.
  • Field Details

    • DEFAULT_MAX_BIGINTEGER_SCALE

      private static final int DEFAULT_MAX_BIGINTEGER_SCALE
      Default maximum value of BigInteger scale value limit.
      See Also:
    • DEFAULT_MAX_BIGDECIMAL_LEN

      private static final int DEFAULT_MAX_BIGDECIMAL_LEN
      Default maximum number of characters of BigDecimal source being parsed.
      See Also:
    • DEFAULT_MAX_DEPTH

      private static final int DEFAULT_MAX_DEPTH
      Default maximum level of nesting.
      See Also:
    • PROPERTY_BUFFER_POOL

      static final String PROPERTY_BUFFER_POOL
      Custom char[] pool instance property. Can be set in properties Map only.
    • config

      private final Map<String,?> config
    • bigIntegerScaleLimit

      private final int bigIntegerScaleLimit
    • bigDecimalLengthLimit

      private final int bigDecimalLengthLimit
    • depthLimit

      private final int depthLimit
    • prettyPrinting

      private final boolean prettyPrinting
    • rejectDuplicateKeys

      private final boolean rejectDuplicateKeys
    • bufferPool

      private final BufferPool bufferPool
  • Constructor Details

    • JsonContext

      JsonContext(Map<String,?> config, BufferPool defaultPool)
      Creates an instance of Parsson configuration.
      Parameters:
      config - a Map of provider specific properties to configure the JSON parsers
      defaultPool - default char[] pool to use when no instance is configured
    • JsonContext

      JsonContext(Map<String,?> config, BufferPool defaultPool, String... properties)
      Creates an instance of Parsson configuration.
      Parameters:
      config - a map of provider specific properties to configure the JSON parsers
      defaultPool - default char[] pool to use when no instance is configured
      properties - properties to store in local copy of provider specific properties Map
  • Method Details

    • config

      Map<String,?> config()
    • config

      Object config(String propertyName)
    • bigIntegerScaleLimit

      int bigIntegerScaleLimit()
    • bigDecimalLengthLimit

      int bigDecimalLengthLimit()
    • depthLimit

      int depthLimit()
    • prettyPrinting

      boolean prettyPrinting()
    • rejectDuplicateKeys

      boolean rejectDuplicateKeys()
    • bufferPool

      BufferPool bufferPool()
    • getBufferPool

      private static BufferPool getBufferPool(Map<String,?> config, BufferPool defaultrPool)
    • getIntConfig

      private static int getIntConfig(String propertyName, Map<String,?> config, int defaultValue) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • getBooleanConfig

      private static boolean getBooleanConfig(String propertyName, Map<String,?> config) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • getIntProperty

      private static Integer getIntProperty(String propertyName, Map<String,?> config) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • getBooleanProperty

      private static Boolean getBooleanProperty(String propertyName, Map<String,?> config) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • getIntSystemProperty

      private static Integer getIntSystemProperty(String propertyName) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • getBooleanSystemProperty

      private static boolean getBooleanSystemProperty(String propertyName) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • getSystemProperty

      private static String getSystemProperty(String propertyName) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • propertyStringToInt

      private static int propertyStringToInt(String propertyName, String propertyValue) throws jakarta.json.JsonException
      Throws:
      jakarta.json.JsonException
    • copyPropertiesMap

      private static Map<String,?> copyPropertiesMap(JsonContext instance, Map<String,?> config, String... properties)