- java.lang.Object
-
- org.eclipse.parsson.JsonContext
-
final class JsonContext extends java.lang.Object
Parsson configuration. Values are composed from propertiesMap
, system properties and default value.
-
-
Field Summary
Fields Modifier and Type Field Description private int
bigDecimalLengthLimit
private int
bigIntegerScaleLimit
private BufferPool
bufferPool
private java.util.Map<java.lang.String,?>
config
private static int
DEFAULT_MAX_BIGDECIMAL_LEN
Default maximum number of characters of BigDecimal source being parsed.private static int
DEFAULT_MAX_BIGINTEGER_SCALE
Default maximum value of BigInteger scale value limit.private static int
DEFAULT_MAX_DEPTH
Default maximum level of nesting.private int
depthLimit
private boolean
prettyPrinting
(package private) static java.lang.String
PROPERTY_BUFFER_POOL
Custom char[] pool instance property.private boolean
rejectDuplicateKeys
-
Constructor Summary
Constructors Constructor Description JsonContext(java.util.Map<java.lang.String,?> config, BufferPool defaultPool)
Creates an instance of Parsson configuration.JsonContext(java.util.Map<java.lang.String,?> config, BufferPool defaultPool, java.lang.String... properties)
Creates an instance of Parsson configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
bigDecimalLengthLimit()
(package private) int
bigIntegerScaleLimit()
(package private) BufferPool
bufferPool()
(package private) java.util.Map<java.lang.String,?>
config()
(package private) java.lang.Object
config(java.lang.String propertyName)
private static java.util.Map<java.lang.String,?>
copyPropertiesMap(JsonContext instance, java.util.Map<java.lang.String,?> config, java.lang.String... properties)
(package private) int
depthLimit()
private static boolean
getBooleanConfig(java.lang.String propertyName, java.util.Map<java.lang.String,?> config)
private static java.lang.Boolean
getBooleanProperty(java.lang.String propertyName, java.util.Map<java.lang.String,?> config)
private static boolean
getBooleanSystemProperty(java.lang.String propertyName)
private static BufferPool
getBufferPool(java.util.Map<java.lang.String,?> config, BufferPool defaultrPool)
private static int
getIntConfig(java.lang.String propertyName, java.util.Map<java.lang.String,?> config, int defaultValue)
private static java.lang.Integer
getIntProperty(java.lang.String propertyName, java.util.Map<java.lang.String,?> config)
private static java.lang.Integer
getIntSystemProperty(java.lang.String propertyName)
private static java.lang.String
getSystemProperty(java.lang.String propertyName)
(package private) boolean
prettyPrinting()
private static int
propertyStringToInt(java.lang.String propertyName, java.lang.String propertyValue)
(package private) boolean
rejectDuplicateKeys()
-
-
-
Field Detail
-
DEFAULT_MAX_BIGINTEGER_SCALE
private static final int DEFAULT_MAX_BIGINTEGER_SCALE
Default maximum value of BigInteger scale value limit.- See Also:
- Constant Field Values
-
DEFAULT_MAX_BIGDECIMAL_LEN
private static final int DEFAULT_MAX_BIGDECIMAL_LEN
Default maximum number of characters of BigDecimal source being parsed.- See Also:
- Constant Field Values
-
DEFAULT_MAX_DEPTH
private static final int DEFAULT_MAX_DEPTH
Default maximum level of nesting.- See Also:
- Constant Field Values
-
PROPERTY_BUFFER_POOL
static final java.lang.String PROPERTY_BUFFER_POOL
Custom char[] pool instance property. Can be set in propertiesMap
only.
-
config
private final java.util.Map<java.lang.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 Detail
-
JsonContext
JsonContext(java.util.Map<java.lang.String,?> config, BufferPool defaultPool)
Creates an instance of Parsson configuration.- Parameters:
config
- aMap
of provider specific properties to configure the JSON parsersdefaultPool
- default char[] pool to use when no instance is configured
-
JsonContext
JsonContext(java.util.Map<java.lang.String,?> config, BufferPool defaultPool, java.lang.String... properties)
Creates an instance of Parsson configuration.- Parameters:
config
- a map of provider specific properties to configure the JSON parsersdefaultPool
- default char[] pool to use when no instance is configuredproperties
- properties to store in local copy of provider specific propertiesMap
-
-
Method Detail
-
config
java.util.Map<java.lang.String,?> config()
-
config
java.lang.Object config(java.lang.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(java.util.Map<java.lang.String,?> config, BufferPool defaultrPool)
-
getIntConfig
private static int getIntConfig(java.lang.String propertyName, java.util.Map<java.lang.String,?> config, int defaultValue) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
getBooleanConfig
private static boolean getBooleanConfig(java.lang.String propertyName, java.util.Map<java.lang.String,?> config) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
getIntProperty
private static java.lang.Integer getIntProperty(java.lang.String propertyName, java.util.Map<java.lang.String,?> config) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
getBooleanProperty
private static java.lang.Boolean getBooleanProperty(java.lang.String propertyName, java.util.Map<java.lang.String,?> config) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
getIntSystemProperty
private static java.lang.Integer getIntSystemProperty(java.lang.String propertyName) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
getBooleanSystemProperty
private static boolean getBooleanSystemProperty(java.lang.String propertyName) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
getSystemProperty
private static java.lang.String getSystemProperty(java.lang.String propertyName) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
propertyStringToInt
private static int propertyStringToInt(java.lang.String propertyName, java.lang.String propertyValue) throws jakarta.json.JsonException
- Throws:
jakarta.json.JsonException
-
copyPropertiesMap
private static java.util.Map<java.lang.String,?> copyPropertiesMap(JsonContext instance, java.util.Map<java.lang.String,?> config, java.lang.String... properties)
-
-