/** * Deprecated version of accessor method that was used before version 1.7. * Implemented as final to ensure that existing code does not accidentally * try to redefine it (given that it is not called by core mapper code) * * @deprecated As of version 1.7, use version that exposes property object * instead of just its type (needed for contextual serializers) */ @Deprecated public final JsonSerializer<Object> findTypedValueSerializer(Class<?> valueType, boolean cache) throws JsonMappingException { return findTypedValueSerializer(valueType, cache, null); }
/** * Deprecated version of accessor method that was used before version 1.7. * Implemented as final to ensure that existing code does not accidentally * try to redefine it (given that it is not called by core mapper code) * * @deprecated As of version 1.7, use version that exposes property object * instead of just its type (needed for contextual serializers) */ @Deprecated public final JsonSerializer<Object> findTypedValueSerializer(JavaType valueType, boolean cache) throws JsonMappingException { return findTypedValueSerializer(valueType, cache, null); }
_valueSerializer = provider.findTypedValueSerializer(t, false, _property);
@Override @SuppressWarnings("deprecation") public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { // First, wrapping: if (_prefix != null) jgen.writeRaw(_prefix); if (_value == null) { provider.defaultSerializeNull(jgen); } else if (_serializationType != null) { provider.findTypedValueSerializer(_serializationType, true, null).serialize(_value, jgen, provider); } else { Class<?> cls = _value.getClass(); provider.findTypedValueSerializer(cls, true, null).serialize(_value, jgen, provider); } if (_suffix != null) jgen.writeRaw(_suffix); }
/** * Convenience method that will serialize given value (which can be * null) using standard serializer locating functionality. It can * be called for all values including field and Map values, but usually * field values are best handled calling * {@link #defaultSerializeField} instead. */ public final void defaultSerializeValue(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { if (value == null) { getNullValueSerializer().serialize(null, jgen, this); } else { Class<?> cls = value.getClass(); findTypedValueSerializer(cls, true, null).serialize(value, jgen, this); } }
ser = prov.findTypedValueSerializer(c, true, _property);
@Override @SuppressWarnings("deprecation") public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { // First, wrapping: jgen.writeRaw(_function); jgen.writeRaw('('); if (_value == null) { provider.defaultSerializeNull(jgen); } else if (_serializationType != null) { provider.findTypedValueSerializer(_serializationType, true, null).serialize(_value, jgen, provider); } else { Class<?> cls = _value.getClass(); provider.findTypedValueSerializer(cls, true, null).serialize(_value, jgen, provider); } jgen.writeRaw(')'); }
/** * Convenience method that will serialize given field with specified * value. Value may be null. Serializer is done using the usual * null) using standard serializer locating functionality. */ public final void defaultSerializeField(String fieldName, Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { jgen.writeFieldName(fieldName); if (value == null) { /* Note: can't easily check for suppression at this point * any more; caller must check it. */ getNullValueSerializer().serialize(null, jgen, this); } else { Class<?> cls = value.getClass(); findTypedValueSerializer(cls, true, null).serialize(value, jgen, this); } }
ser = provider.findTypedValueSerializer(c, true, _property);
/** * Deprecated version of accessor method that was used before version 1.7. * Implemented as final to ensure that existing code does not accidentally * try to redefine it (given that it is not called by core mapper code) * * @deprecated As of version 1.7, use version that exposes property object * instead of just its type (needed for contextual serializers) */ @Deprecated public final JsonSerializer<Object> findTypedValueSerializer(Class<?> valueType, boolean cache) throws JsonMappingException { return findTypedValueSerializer(valueType, cache, null); }
/** * Deprecated version of accessor method that was used before version 1.7. * Implemented as final to ensure that existing code does not accidentally * try to redefine it (given that it is not called by core mapper code) * * @deprecated As of version 1.7, use version that exposes property object * instead of just its type (needed for contextual serializers) */ @Deprecated public final JsonSerializer<Object> findTypedValueSerializer(JavaType valueType, boolean cache) throws JsonMappingException { return findTypedValueSerializer(valueType, cache, null); }
@Override public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { if (jsonSource == null) { provider.getNullValueSerializer().serialize(null, jgen, provider); } else { Class<?> cls = jsonSource.getClass(); provider.findTypedValueSerializer(cls, true).serialize(jsonSource, jgen, provider); } }
@Override @SuppressWarnings("deprecation") public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { // First, wrapping: if (_prefix != null) jgen.writeRaw(_prefix); if (_value == null) { provider.defaultSerializeNull(jgen); } else if (_serializationType != null) { provider.findTypedValueSerializer(_serializationType, true, null).serialize(_value, jgen, provider); } else { Class<?> cls = _value.getClass(); provider.findTypedValueSerializer(cls, true, null).serialize(_value, jgen, provider); } if (_suffix != null) jgen.writeRaw(_suffix); }
ser = prov.findTypedValueSerializer(c, true, _property);
/** * Convenience method that will serialize given value (which can be * null) using standard serializer locating functionality. It can * be called for all values including field and Map values, but usually * field values are best handled calling * {@link #defaultSerializeField} instead. */ public final void defaultSerializeValue(Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { if (value == null) { getNullValueSerializer().serialize(null, jgen, this); } else { Class<?> cls = value.getClass(); findTypedValueSerializer(cls, true, null).serialize(value, jgen, this); } }
_valueSerializer = provider.findTypedValueSerializer(t, false, _property);
@Override @SuppressWarnings("deprecation") public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { // First, wrapping: jgen.writeRaw(_function); jgen.writeRaw('('); if (_value == null) { provider.defaultSerializeNull(jgen); } else if (_serializationType != null) { provider.findTypedValueSerializer(_serializationType, true, null).serialize(_value, jgen, provider); } else { Class<?> cls = _value.getClass(); provider.findTypedValueSerializer(cls, true, null).serialize(_value, jgen, provider); } jgen.writeRaw(')'); }
/** * Convenience method that will serialize given field with specified * value. Value may be null. Serializer is done using the usual * null) using standard serializer locating functionality. */ public final void defaultSerializeField(String fieldName, Object value, JsonGenerator jgen) throws IOException, JsonProcessingException { jgen.writeFieldName(fieldName); if (value == null) { /* Note: can't easily check for suppression at this point * any more; caller must check it. */ getNullValueSerializer().serialize(null, jgen, this); } else { Class<?> cls = value.getClass(); findTypedValueSerializer(cls, true, null).serialize(value, jgen, this); } }
ser = provider.findTypedValueSerializer(c, true, _property);
@Override public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { if (jsonSource == null) { provider.getNullValueSerializer().serialize(null, jgen, provider); } else { Class<?> cls = jsonSource.getClass(); provider.findTypedValueSerializer(cls, true).serialize(jsonSource, jgen, provider); } }