public WritableTypeId typeId(Object value, JsonToken valueShape, Object id) { WritableTypeId typeId = typeId(value, valueShape); typeId.id = id; return typeId; }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypePrefixForObject(Object value, JsonGenerator g) throws IOException { writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypeSuffix(g, typeId(value, JsonToken.VALUE_STRING));}. * See {@link #writeTypeSuffix} for more info. * * @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypeSuffixForScalar(Object value, JsonGenerator g) throws IOException { _writeLegacySuffix(g, typeId(value, JsonToken.VALUE_STRING)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, type, JsonToken.START_OBJECT));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypePrefixForObject(Object value, JsonGenerator g, Class<?> type) throws IOException { writeTypePrefix(g, typeId(value, type, JsonToken.START_OBJECT)); }
/** * @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeCustomTypeSuffixForObject(Object value, JsonGenerator g, String typeId) throws IOException { _writeLegacySuffix(g, typeId(value, JsonToken.START_OBJECT, typeId)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypePrefixForScalar(Object value, JsonGenerator g) throws IOException { writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypeSuffix(g, typeId(value, JsonToken.START_OBJECT));}. * See {@link #writeTypeSuffix} for more info. * * @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypeSuffixForObject(Object value, JsonGenerator g) throws IOException { _writeLegacySuffix(g, typeId(value, JsonToken.START_OBJECT)); }
/** * @deprecated Since 2.9 use {@link #writeTypeSuffix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeCustomTypeSuffixForArray(Object value, JsonGenerator g, String typeId) throws IOException { _writeLegacySuffix(g, typeId(value, JsonToken.START_ARRAY, typeId)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, type, JsonToken.VALUE_STRING));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypePrefixForScalar(Object value, JsonGenerator g, Class<?> type) throws IOException { writeTypePrefix(g, typeId(value, type, JsonToken.VALUE_STRING)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, type, JsonToken.START_ARRAY));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypePrefixForArray(Object value, JsonGenerator g, Class<?> type) throws IOException { writeTypePrefix(g, typeId(value, type, JsonToken.START_ARRAY)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeTypePrefixForArray(Object value, JsonGenerator g) throws IOException { writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING, typeId));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeCustomTypePrefixForScalar(Object value, JsonGenerator g, String typeId) throws IOException { writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING, typeId)); }
/** * DEPRECATED: now equivalent to: *{@code writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY, typeId));}. * See {@link #writeTypePrefix} for more info. * * @deprecated Since 2.9 use {@link #writeTypePrefix(JsonGenerator, WritableTypeId)} instead */ @Deprecated // since 2.9 public void writeCustomTypePrefixForArray(Object value, JsonGenerator g, String typeId) throws IOException { writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY, typeId)); }
@Override public void serializeWithType(List<String> value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, typeSer.typeId(value, JsonToken.START_ARRAY)); serializeContents(value, g, provider, value.size()); typeSer.writeTypeSuffix(g, typeIdDef); }
@Override public void serializeWithType(InetAddress value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { // Better ensure we don't use specific sub-classes... WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, typeSer.typeId(value, InetAddress.class, JsonToken.VALUE_STRING)); serialize(value, g, provider); typeSer.writeTypeSuffix(g, typeIdDef); } }
@Override public void serializeWithType(T value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, typeSer.typeId(value, JsonToken.VALUE_EMBEDDED_OBJECT)); serialize(value, g, provider); typeSer.writeTypeSuffix(g, typeIdDef); }
@Override public void serializeWithType(Path value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { // Better ensure we don't use specific sub-classes: WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, typeSer.typeId(value, Path.class, JsonToken.VALUE_STRING)); serialize(value, g, provider); typeSer.writeTypeSuffix(g, typeIdDef); } }
@Override public void serializeWithType(TimeZone value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { // Better ensure we don't use specific sub-classes: WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, typeSer.typeId(value, TimeZone.class, JsonToken.VALUE_STRING)); serialize(value, g, provider); typeSer.writeTypeSuffix(g, typeIdDef); } }
@Override public void serializeWithType(Map.Entry<?, ?> value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { // [databind#631]: Assign current value, to be accessible by custom serializers g.setCurrentValue(value); WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, typeSer.typeId(value, JsonToken.START_OBJECT)); serializeDynamic(value, g, provider); typeSer.writeTypeSuffix(g, typeIdDef); }
@Override public void serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException { WritableTypeId typeIdDef = typeSer.writeTypePrefix(g, typeSer.typeId(this, asToken())); serialize(g, provider); typeSer.writeTypeSuffix(g, typeIdDef); }