JsonOptions Class

  • java.lang.Object
    • com.azure.json.JsonOptions

public final class JsonOptions

Contains configuration options for creating a JsonReader or JsonWriter.

Constructor Summary

Constructor Description
JsonOptions()

Creates an instance of JsonOptions.

Method Summary

Modifier and Type Method and Description
boolean isJsoncSupported()

Whether JSONC (JSON with comments) is supported.

boolean isNonNumericNumbersSupported()

Whether non-numeric numbers such as NaN and INF and -INF are supported.

JsonOptions setJsoncSupported(boolean jsoncSupported)

Sets whether JSONC (JSON with comments) is supported.

JsonOptions setNonNumericNumbersSupported(boolean nonNumericNumbersSupported)

Sets whether non-numeric numbers such as NaN and INF and -INF are supported.

Methods inherited from java.lang.Object

Constructor Details

JsonOptions

public JsonOptions()

Creates an instance of JsonOptions.

Method Details

isJsoncSupported

public boolean isJsoncSupported()

Whether JSONC (JSON with comments) is supported. By default, this is configured to false.

Returns:

Whether JSONC is supported.

isNonNumericNumbersSupported

public boolean isNonNumericNumbersSupported()

Whether non-numeric numbers such as NaN and INF and -INF are supported.

By default, this is configured to true.

Returns:

Whether non-numeric numbers are supported.

setJsoncSupported

public JsonOptions setJsoncSupported(boolean jsoncSupported)

Sets whether JSONC (JSON with comments) is supported. By default, this is configured to false.

Parameters:

jsoncSupported - Whether JSONC is supported.

Returns:

The updated JsonOptions object.

setNonNumericNumbersSupported

public JsonOptions setNonNumericNumbersSupported(boolean nonNumericNumbersSupported)

Sets whether non-numeric numbers such as NaN and INF and -INF are supported.

By default, this is configured to true.

Parameters:

nonNumericNumbersSupported - Whether non-numeric numbers are supported.

Returns:

The updated JsonOptions object.

Applies to