本文整理匯總了Java中com.fasterxml.jackson.databind.jsontype.TypeSerializer.writeTypeSuffixForObject方法的典型用法代碼示例。如果您正苦於以下問題:Java TypeSerializer.writeTypeSuffixForObject方法的具體用法?Java TypeSerializer.writeTypeSuffixForObject怎麽用?Java TypeSerializer.writeTypeSuffixForObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.fasterxml.jackson.databind.jsontype.TypeSerializer
的用法示例。
在下文中一共展示了TypeSerializer.writeTypeSuffixForObject方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: serializeWithType
import com.fasterxml.jackson.databind.jsontype.TypeSerializer; //導入方法依賴的package包/類
@Override
public void serializeWithType(final X509CertificateCredential value, final JsonGenerator generator,
final SerializerProvider serializers, final TypeSerializer typeSer) throws IOException {
try {
typeSer.writeTypePrefixForObject(value, generator);
serialize(value, generator, serializers);
typeSer.writeTypeSuffixForObject(value, generator);
} catch (final Exception e) {
throw new JsonMappingException("Unable to serialize X509 certificate", e);
}
}
示例2: serializeWithType
import com.fasterxml.jackson.databind.jsontype.TypeSerializer; //導入方法依賴的package包/類
@Override
public void serializeWithType( final ContainerResource value, final JsonGenerator gen,
final SerializerProvider serializers, final TypeSerializer typeSer )
throws IOException
{
typeSer.writeTypePrefixForObject( value, gen );
serialize( value, gen, serializers );
typeSer.writeTypeSuffixForObject( value, gen );
}
示例3: serializeWithType
import com.fasterxml.jackson.databind.jsontype.TypeSerializer; //導入方法依賴的package包/類
@Override
public void serializeWithType(JsonObject value, JsonGenerator jgen, SerializerProvider provider,
TypeSerializer typeSer)
throws IOException {
typeSer.writeTypePrefixForObject(value, jgen);
serializeContents(value, jgen, provider);
typeSer.writeTypeSuffixForObject(value, jgen);
}