/** * Fluent factory method that will construct a new instance with * specified {@link JsonNodeFactory} */ public DeserializationConfig with(JsonNodeFactory f) { if (_nodeFactory == f) { return this; } return new DeserializationConfig(this, f); }
@Override // since 2.9 protected final DeserializationConfig _withMapperFeatures(int mapperFeatures) { return new DeserializationConfig(this, mapperFeatures, _deserFeatures, _parserFeatures, _parserFeaturesToChange, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Method for removing all configured problem handlers; usually done to replace * existing handler(s) with different one(s) */ public DeserializationConfig withNoProblemHandlers() { if (_problemHandlers == null) { return this; } return new DeserializationConfig(this, (LinkedNode<DeserializationProblemHandler>) null); }
@Override // since 2.9 protected final DeserializationConfig _withBase(BaseSettings newBase) { return (_base == newBase) ? this : new DeserializationConfig(this, newBase); }
@Override public DeserializationConfig with(ContextAttributes attrs) { return (attrs == _attributes) ? this : new DeserializationConfig(this, attrs); }
@Override public DeserializationConfig withView(Class<?> view) { return (_view == view) ? this : new DeserializationConfig(this, view); }
@Override public DeserializationConfig with(SubtypeResolver str) { return (_subtypeResolver == str) ? this : new DeserializationConfig(this, str); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features enabled. */ public DeserializationConfig with(DeserializationFeature feature) { int newDeserFeatures = (_deserFeatures | feature.getMask()); return (newDeserFeatures == _deserFeatures) ? this : new DeserializationConfig(this, _mapperFeatures, newDeserFeatures, _parserFeatures, _parserFeaturesToChange, _formatReadFeatures, _formatReadFeaturesToChange); }
@Override public DeserializationConfig withRootName(PropertyName rootName) { if (rootName == null) { if (_rootName == null) { return this; } } else if (rootName.equals(_rootName)) { return this; } return new DeserializationConfig(this, rootName); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified feature disabled. */ public DeserializationConfig without(DeserializationFeature feature) { int newDeserFeatures = _deserFeatures & ~feature.getMask(); return (newDeserFeatures == _deserFeatures) ? this : new DeserializationConfig(this, _mapperFeatures, newDeserFeatures, _parserFeatures, _parserFeaturesToChange, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features disabled. */ public DeserializationConfig withoutFeatures(DeserializationFeature... features) { int newDeserFeatures = _deserFeatures; for (DeserializationFeature f : features) { newDeserFeatures &= ~f.getMask(); } return (newDeserFeatures == _deserFeatures) ? this : new DeserializationConfig(this, _mapperFeatures, newDeserFeatures, _parserFeatures, _parserFeaturesToChange, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features enabled. */ public DeserializationConfig withFeatures(DeserializationFeature... features) { int newDeserFeatures = _deserFeatures; for (DeserializationFeature f : features) { newDeserFeatures |= f.getMask(); } return (newDeserFeatures == _deserFeatures) ? this : new DeserializationConfig(this, _mapperFeatures, newDeserFeatures, _parserFeatures, _parserFeaturesToChange, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features enabled. * * @since 2.7 */ public DeserializationConfig with(FormatFeature feature) { int newSet = _formatReadFeatures | feature.getMask(); int newMask = _formatReadFeaturesToChange | feature.getMask(); return ((_formatReadFeatures == newSet) && (_formatReadFeaturesToChange == newMask)) ? this : new DeserializationConfig(this, _mapperFeatures, _deserFeatures, _parserFeatures, _parserFeaturesToChange, newSet, newMask); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified feature disabled. * * @since 2.7 */ public DeserializationConfig without(FormatFeature feature) { int newSet = _formatReadFeatures & ~feature.getMask(); int newMask = _formatReadFeaturesToChange | feature.getMask(); return ((_formatReadFeatures == newSet) && (_formatReadFeaturesToChange == newMask)) ? this : new DeserializationConfig(this, _mapperFeatures, _deserFeatures, _parserFeatures, _parserFeaturesToChange, newSet, newMask); }
/** * 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); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features enabled. */ public DeserializationConfig with(DeserializationFeature first, DeserializationFeature... features) { int newDeserFeatures = _deserFeatures | first.getMask(); for (DeserializationFeature f : features) { newDeserFeatures |= f.getMask(); } return (newDeserFeatures == _deserFeatures) ? this : new DeserializationConfig(this, _mapperFeatures, newDeserFeatures, _parserFeatures, _parserFeaturesToChange, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features disabled. */ public DeserializationConfig without(DeserializationFeature first, DeserializationFeature... features) { int newDeserFeatures = _deserFeatures & ~first.getMask(); for (DeserializationFeature f : features) { newDeserFeatures &= ~f.getMask(); } return (newDeserFeatures == _deserFeatures) ? this : new DeserializationConfig(this, _mapperFeatures, newDeserFeatures, _parserFeatures, _parserFeaturesToChange, _formatReadFeatures, _formatReadFeaturesToChange); }
/** * Method that can be called to specify given resolver for locating * mix-in classes to use, overriding directly added mappings. * Note that direct mappings are not cleared, but they are only applied * if resolver does not provide mix-in matches. * * @since 2.6 */ public ObjectMapper setMixInResolver(ClassIntrospector.MixInResolver resolver) { SimpleMixInResolver r = _mixIns.withOverrides(resolver); if (r != _mixIns) { _mixIns = r; _deserializationConfig = new DeserializationConfig(_deserializationConfig, r); _serializationConfig = new SerializationConfig(_serializationConfig, r); } return this; }
/** * Method that can be used to add a handler that can (try to) * resolve non-fatal deserialization problems. */ public DeserializationConfig withHandler(DeserializationProblemHandler h) { // Sanity check: let's prevent adding same handler multiple times if (LinkedNode.contains(_problemHandlers, h)) { return this; } return new DeserializationConfig(this, new LinkedNode<DeserializationProblemHandler>(h, _problemHandlers)); }