/** * Method for disabling specified feature * (check {@link Feature} for list of features) */ public JsonParser disable(Feature f) { _features &= ~f.getMask(); return this; }
/** * Method for enabling specified parser feature * (check {@link Feature} for list of features) */ public JsonParser enable(Feature f) { _features |= f.getMask(); return this; }
/** * Method for disabling specified parser features * (check {@link JsonParser.Feature} for list of features) */ public JsonFactory disable(JsonParser.Feature f) { _parserFeatures &= ~f.getMask(); return this; }
/** * Checked whether specified parser feature is enabled. */ public final boolean isEnabled(JsonParser.Feature f) { return (_parserFeatures & f.getMask()) != 0; }
/** * Method for disabling specified parser features * (check {@link JsonParser.Feature} for list of features) */ public JsonFactory disable(JsonParser.Feature f) { _parserFeatures &= ~f.getMask(); return this; }
@Override public JsonParser disable(Feature f) { _features &= ~f.getMask(); if (f == Feature.STRICT_DUPLICATE_DETECTION) { _parsingContext = _parsingContext.withDupDetector(null); } return this; }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features enabled. * * @since 2.5 */ public DeserializationConfig withFeatures(JsonParser.Feature... features) { int newSet = _parserFeatures; int newMask = _parserFeaturesToChange; for (JsonParser.Feature f : features) { int mask = f.getMask(); newSet |= mask; newMask |= mask; } return ((_parserFeatures == newSet) && (_parserFeaturesToChange == newMask)) ? this : new DeserializationConfig(this, _mapperFeatures, _deserFeatures, newSet, newMask, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features disabled. * * @since 2.5 */ public DeserializationConfig withoutFeatures(JsonParser.Feature... features) { int newSet = _parserFeatures; int newMask = _parserFeaturesToChange; for (JsonParser.Feature f : features) { int mask = f.getMask(); newSet &= ~mask; newMask |= mask; } return ((_parserFeatures == newSet) && (_parserFeaturesToChange == newMask)) ? this : new DeserializationConfig(this, _mapperFeatures, _deserFeatures, newSet, newMask, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Helper method called to verify changes to standard features. * * @param newFeatureFlags Bitflag of standard features after they were changed * @param changedFeatures Bitflag of standard features for which setting * did change * * @since 2.7 */ protected void _checkStdFeatureChanges(int newFeatureFlags, int changedFeatures) { int f = Feature.STRICT_DUPLICATE_DETECTION.getMask(); if ((changedFeatures & f) != 0) { if ((newFeatureFlags & f) != 0) { if (_parsingContext.getDupDetector() == null) { _parsingContext = _parsingContext.withDupDetector(DupDetector.rootDetector(this)); } else { // disabling _parsingContext = _parsingContext.withDupDetector(null); } } } }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified feature disabled. * * @since 2.5 */ public DeserializationConfig without(JsonParser.Feature feature) { int newSet = _parserFeatures & ~feature.getMask(); int newMask = _parserFeaturesToChange | feature.getMask(); return ((_parserFeatures == newSet) && (_parserFeaturesToChange == newMask)) ? this : new DeserializationConfig(this, _mapperFeatures, _deserFeatures, newSet, newMask, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features enabled. * * @since 2.5 */ public DeserializationConfig with(JsonParser.Feature feature) { int newSet = _parserFeatures | feature.getMask(); int newMask = _parserFeaturesToChange | feature.getMask(); return ((_parserFeatures == newSet) && (_parserFeaturesToChange == newMask)) ? this : new DeserializationConfig(this, _mapperFeatures, _deserFeatures, newSet, newMask, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Method that calculates bit set (flags) of all features that * are enabled by default. */ public static int collectDefaults() { int flags = 0; for (Feature f : values()) { if (f.enabledByDefault()) { flags |= f.getMask(); } } return flags; }
/** * Method for enabling specified parser feature * (check {@link Feature} for list of features) */ public JsonParser enable(Feature f) { _features |= f.getMask(); return this; }
/** * Method for disabling specified feature * (check {@link Feature} for list of features) */ public JsonParser disable(Feature f) { _features &= ~f.getMask(); return this; }
@Override public JsonParser disable(Feature f) { _features &= ~f.getMask(); if (f == Feature.STRICT_DUPLICATE_DETECTION) { _parsingContext = _parsingContext.withDupDetector(null); } return this; }
@Override public JsonParser enable(Feature f) { _features |= f.getMask(); if (f == Feature.STRICT_DUPLICATE_DETECTION) { // enabling dup detection? if (_parsingContext.getDupDetector() == null) { // but only if disabled currently _parsingContext = _parsingContext.withDupDetector(DupDetector.rootDetector(this)); } } return this; }
/** * Method for enabling specified parser feature * (check {@link JsonParser.Feature} for list of features) */ public JsonFactory enable(JsonParser.Feature f) { _parserFeatures |= f.getMask(); return this; }
/** * Checked whether specified parser feature is enabled. */ public final boolean isEnabled(JsonParser.Feature f) { return (_parserFeatures & f.getMask()) != 0; }
/** * Method for disabling specified parser features * (check {@link JsonParser.Feature} for list of features) */ public JsonFactory disable(JsonParser.Feature f) { _parserFeatures &= ~f.getMask(); return this; }