/** * Factory method sub-classes must override, to produce {@link ObjectWriter} * instances of proper sub-type * * @since 2.5 */ protected ObjectWriter _newWriter(SerializationConfig config, FormatSchema schema) { return new ObjectWriter(this, config, schema); }
/** * Overridable factory method called by various "withXxx()" methods * * @since 2.5 */ protected ObjectWriter _new(ObjectWriter base, JsonFactory f) { return new ObjectWriter(base, f); }
/** * Factory method sub-classes must override, to produce {@link ObjectWriter} * instances of proper sub-type * * @since 2.5 */ protected ObjectWriter _newWriter(SerializationConfig config, JavaType rootType, PrettyPrinter pp) { return new ObjectWriter(this, config, rootType, pp); }
/** * Overridable factory method called by various "withXxx()" methods * * @since 2.5 */ protected ObjectWriter _new(ObjectWriter base, SerializationConfig config) { if (config == _config) { return this; } return new ObjectWriter(base, config); }
/** * Factory method sub-classes must override, to produce {@link ObjectWriter} * instances of proper sub-type * * @since 2.5 */ protected ObjectWriter _newWriter(SerializationConfig config) { return new ObjectWriter(this, config); }
/** * Overridable factory method called by various "withXxx()" methods. * It assumes `this` as base for settings other than those directly * passed in. * * @since 2.5 */ protected ObjectWriter _new(GeneratorSettings genSettings, Prefetch prefetch) { if ((_generatorSettings == genSettings) && (_prefetch == prefetch)) { return this; } return new ObjectWriter(this, _config, genSettings, prefetch); }
/** * Overridable factory method called by various "withXxx()" methods * * @since 2.5 */ protected ObjectWriter _new(ObjectWriter base, SerializationConfig config) { return new ObjectWriter(base, config); }
/** * Factory method sub-classes must override, to produce {@link ObjectWriter} * instances of proper sub-type * * @since 2.5 */ protected ObjectWriter _newWriter(SerializationConfig config, FormatSchema schema) { return new ObjectWriter(this, config, schema); }
/** * Factory method sub-classes must override, to produce {@link ObjectWriter} * instances of proper sub-type * * @since 2.5 */ protected ObjectWriter _newWriter(SerializationConfig config) { return new ObjectWriter(this, config); }
/** * Factory method sub-classes must override, to produce {@link ObjectWriter} * instances of proper sub-type * * @since 2.5 */ protected ObjectWriter _newWriter(SerializationConfig config, FormatSchema schema) { return new ObjectWriter(this, config, schema); }
/** * Overridable factory method called by various "withXxx()" methods * * @since 2.5 */ protected ObjectWriter _new(ObjectWriter base, JsonFactory f) { return new ObjectWriter(base, f); }
/** * Overridable factory method called by various "withXxx()" methods. * It assumes `this` as base for settings other than those directly * passed in. * * @since 2.5 */ protected ObjectWriter _new(GeneratorSettings genSettings, Prefetch prefetch) { return new ObjectWriter(this, _config, genSettings, prefetch); }
/** * Overridable factory method called by various "withXxx()" methods * * @since 2.5 */ protected ObjectWriter _new(ObjectWriter base, SerializationConfig config) { if (config == _config) { return this; } return new ObjectWriter(base, config); }
/** * Factory method for constructing {@link ObjectWriter} that will * pass specific schema object to {@link JsonGenerator} used for * writing content. * * @param schema Schema to pass to generator */ public ObjectWriter writer(FormatSchema schema) { return new ObjectWriter(this, getSerializationConfig(), schema); }
/** * Method for constructing a new instance that is configured * with specified features enabled. */ public ObjectWriter with(SerializationFeature first, SerializationFeature... other) { SerializationConfig newConfig = _config.with(first, other); return (newConfig == _config) ? this : new ObjectWriter(this, newConfig); }
/** * Method for constructing a new instance that is configured * with specified features enabled. */ public ObjectWriter with(SerializationFeature first, SerializationFeature... other) { SerializationConfig newConfig = _config.with(first, other); return (newConfig == _config) ? this : new ObjectWriter(this, newConfig); }
/** * Method for constructing a new instance that is configured * with specified features enabled. */ public ObjectWriter withoutFeatures(SerializationFeature... features) { SerializationConfig newConfig = _config.withoutFeatures(features); return (newConfig == _config) ? this : new ObjectWriter(this, newConfig); }
/** * Factory method for constructing {@link ObjectWriter} that will * serialize objects using specified root type, instead of actual * runtime type of value. Type must be a super-type of runtime * type. */ public ObjectWriter writerWithType(Class<?> rootType) { JavaType t = (rootType == null) ? null : _typeFactory.constructType(rootType); return new ObjectWriter(this, getSerializationConfig(), t, /*PrettyPrinter*/null); }
/** * Factory method for constructing {@link ObjectWriter} that will * serialize objects using specified pretty printer for indentation * (or if null, no pretty printer) */ public ObjectWriter writer(PrettyPrinter pp) { if (pp == null) { // need to use a marker to indicate explicit disabling of pp pp = ObjectWriter.NULL_PRETTY_PRINTER; } return new ObjectWriter(this, getSerializationConfig(), /*root type*/ null, pp); }
/** * Method for constructing a new instance that is configured * with specified features enabled. */ public ObjectWriter without(SerializationFeature first, SerializationFeature... other) { SerializationConfig newConfig = _config.without(first, other); return (newConfig == _config) ? this : new ObjectWriter(this, newConfig); }