Java Code Examples for com.fasterxml.jackson.databind.jsontype.TypeSerializer#writeTypeSuffixForScalar()

The following examples show how to use com.fasterxml.jackson.databind.jsontype.TypeSerializer#writeTypeSuffixForScalar() . 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 Project: onetwo   File: UrlJsonSerializer.java    License: Apache License 2.0 5 votes vote down vote up
/****
	 * 序列化需要类型形式时,即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 Project: vavr-jackson   File: HListSerializer.java    License: Apache License 2.0 5 votes vote down vote up
@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 Project: vavr-jackson   File: ValueSerializer.java    License: Apache License 2.0 5 votes vote down vote up
@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
@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 Project: onetwo   File: JsonDateOnlySerializer.java    License: Apache License 2.0 4 votes vote down vote up
@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 Project: onetwo   File: JsonTimeOnlySerializer.java    License: Apache License 2.0 4 votes vote down vote up
@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 Project: onetwo   File: TemporalSerializer.java    License: Apache License 2.0 4 votes vote down vote up
@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);
}