Package org.apache.sling.contentparser.json

# Class JSONParserOptions

java.lang.Object
org.apache.sling.contentparser.api.ParserOptions
org.apache.sling.contentparser.json.JSONParserOptions

@ConsumerType public final class JSONParserOptions extends org.apache.sling.contentparser.api.ParserOptions
Defines specific JSON parser options which can be used with the JSON `ContentParser` implementations provided by this bundle.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Set<JSONParserFeature>`
`DEFAULT_JSON_PARSER_FEATURES`
List of JSON parser features activated by default.

### Fields inherited from class org.apache.sling.contentparser.api.ParserOptions

`DEFAULT_IGNORE_RESOURCE_NAMES, DEFAULT_PRIMARY_TYPE, DEFAULT_REMOVE_PROPERTY_NAME_PREFIXES`

## Constructor Summary

Constructors
Constructor
Description
`JSONParserOptions()`

## Method Summary

Modifier and Type
Method
Description
`Set<JSONParserFeature>`
`getFeatures()`
Returns a copy of the features encapsulated by this instance.
`JSONParserOptions`
`withFeatures(Set<JSONParserFeature> value)`
Set the features the JSON parser should apply when parsing files.
`JSONParserOptions`
`withFeatures(JSONParserFeature... value)`
Set the features the JSON parser should apply when parsing files.

### Methods inherited from class org.apache.sling.contentparser.api.ParserOptions

`defaultPrimaryType, detectCalendarValues, getDefaultPrimaryType, getIgnorePropertyNames, getIgnoreResourceNames, getRemovePropertyNamePrefixes, ignorePropertyNames, ignoreResourceNames, isDetectCalendarValues, removePropertyNamePrefixes`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DEFAULT_JSON_PARSER_FEATURES

public static final Set<JSONParserFeature> DEFAULT_JSON_PARSER_FEATURES
List of JSON parser features activated by default.

## Constructor Details

### JSONParserOptions

public JSONParserOptions()

## Method Details

### withFeatures

public JSONParserOptions withFeatures(Set<JSONParserFeature> value)
Set the features the JSON parser should apply when parsing files.

Parameters:
  `value` - JSON parser features
Returns:
  this

### withFeatures

public JSONParserOptions withFeatures(JSONParserFeature... value)
Set the features the JSON parser should apply when parsing files.

Parameters:
  `value` - JSON parser features
Returns:
  this

### getFeatures

public Set<JSONParserFeature> getFeatures()
Returns a copy of the features encapsulated by this instance. For modifying the set of features please use the `withFeatures` fluid methods.

Returns:
  the features the JSON parser should apply when parsing files