Java Code Examples for com.fasterxml.jackson.databind.jsontype.TypeSerializer#writeTypePrefixForScalar()
The following examples show how to use
com.fasterxml.jackson.databind.jsontype.TypeSerializer#writeTypePrefixForScalar() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UrlJsonSerializer.java From onetwo with Apache License 2.0 | 5 votes |
/**** * 序列化需要类型形式时,即objectMapper.enableDefaultTyping(DefaultTyping.NON_FINAL, As.PROPERTY),必须实现此方法 */ @Override public void serializeWithType(Object value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, serializers); // typeSer.writeTypePrefixForScalar(value, gen); typeSer.writeTypeSuffixForScalar(value, gen); }
Example 2
Source File: HListSerializer.java From vavr-jackson with Apache License 2.0 | 5 votes |
@Override public void serializeWithType(T value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, serializers); typeSer.writeTypeSuffixForScalar(value, gen); }
Example 3
Source File: ValueSerializer.java From vavr-jackson with Apache License 2.0 | 5 votes |
@Override public void serializeWithType(T value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, serializers); typeSer.writeTypeSuffixForScalar(value, gen); }
Example 4
Source File: BigDecimalSerializer.java From n2o-framework with Apache License 2.0 | 4 votes |
@Override public void serializeWithType(BigDecimal value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, null); typeSer.writeTypeSuffixForScalar(value, gen); }
Example 5
Source File: JsonDateOnlySerializer.java From onetwo with Apache License 2.0 | 4 votes |
@Override public void serializeWithType(Date value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, serializers); typeSer.writeTypeSuffixForScalar(value, gen); }
Example 6
Source File: JsonTimeOnlySerializer.java From onetwo with Apache License 2.0 | 4 votes |
@Override public void serializeWithType(Date value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, serializers); typeSer.writeTypeSuffixForScalar(value, gen); }
Example 7
Source File: TemporalSerializer.java From onetwo with Apache License 2.0 | 4 votes |
@Override public void serializeWithType(Temporal value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, serializers); typeSer.writeTypeSuffixForScalar(value, gen); }