本文整理汇总了Java中com.fasterxml.jackson.databind.JsonSerializable类的典型用法代码示例。如果您正苦于以下问题:Java JsonSerializable类的具体用法?Java JsonSerializable怎么用?Java JsonSerializable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JsonSerializable类属于com.fasterxml.jackson.databind包,在下文中一共展示了JsonSerializable类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jsonSerializableResponseView
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
@Test
public void jsonSerializableResponseView() throws Exception {
ModelResponse<? extends Sushi> response = Bastion.request(FileRequest.post("http://localhost:9876/sushi",
"classpath:/json/create_sushi_request.json"))
.bind(Sushi.class)
.call()
.getResponse();
Optional<JsonSerializable.Base> node = response.getView(JsonSerializable.Base.class);
assertThat(node).isNotEmpty();
}
示例2: findSerializerByAnnotations
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
protected final JsonSerializer<?> findSerializerByAnnotations(SerializerProvider paramSerializerProvider, JavaType paramJavaType, BeanDescription paramBeanDescription)
{
if (JsonSerializable.class.isAssignableFrom(paramJavaType.getRawClass()))
return SerializableSerializer.instance;
AnnotatedMethod localAnnotatedMethod = paramBeanDescription.findJsonValueMethod();
if (localAnnotatedMethod != null)
{
Method localMethod = localAnnotatedMethod.getAnnotated();
if (paramSerializerProvider.canOverrideAccessModifiers())
ClassUtil.checkAndFixAccess(localMethod);
return new JsonValueSerializer(localMethod, findSerializerFromAnnotation(paramSerializerProvider, localAnnotatedMethod));
}
return null;
}
示例3: serializeWithType
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
@Override
public final void serializeWithType(JsonSerializable value, JsonGenerator jgen, SerializerProvider provider,
TypeSerializer typeSer)
throws IOException, JsonGenerationException
{
value.serializeWithType(jgen, provider, typeSer);
}
示例4: SerializableSerializer
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
protected SerializableSerializer()
{
super(JsonSerializable.class);
}
示例5: serialize
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
public void serialize(JsonSerializable paramJsonSerializable, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
{
paramJsonSerializable.serialize(paramJsonGenerator, paramSerializerProvider);
}
示例6: serializeWithType
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
public final void serializeWithType(JsonSerializable paramJsonSerializable, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider, TypeSerializer paramTypeSerializer)
{
paramJsonSerializable.serializeWithType(paramJsonGenerator, paramSerializerProvider, paramTypeSerializer);
}
示例7: serialize
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
@Override
public void serialize(JsonSerializable value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonGenerationException
{
value.serialize(jgen, provider);
}
示例8: SerializableSerializer
import com.fasterxml.jackson.databind.JsonSerializable; //导入依赖的package包/类
protected SerializableSerializer() { super(JsonSerializable.class); }