public class JacksonStringSerializer extends Object implements ContextSerializer<String>
| Constructor and Description |
|---|
JacksonStringSerializer() |
| Modifier and Type | Method and Description |
|---|---|
Class<String> |
dataType()
数据类型
|
Object |
deserialize(String data,
Type toType)
反序列化
|
Object |
deserializeFromBody(org.noear.solon.core.handle.Context ctx,
Type bodyType)
反序列化主体
|
com.fasterxml.jackson.databind.ObjectMapper |
getConfig()
获取配置
|
Set<com.fasterxml.jackson.databind.SerializationFeature> |
getCustomFeatures()
获取定制特性
|
com.fasterxml.jackson.databind.module.SimpleModule |
getCustomModule()
获取模块特性
|
protected void |
init()
初始化
|
boolean |
matched(org.noear.solon.core.handle.Context ctx,
String mime)
是否匹配
|
String |
mimeType()
内容类型
|
String |
name()
序列化器名字
|
String |
serialize(Object obj)
序列化
|
void |
serializeToBody(org.noear.solon.core.handle.Context ctx,
Object data)
序列化主体
|
void |
setConfig(com.fasterxml.jackson.databind.ObjectMapper config)
设置配置
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbodyRequired, deserializeFromBodypublic Set<com.fasterxml.jackson.databind.SerializationFeature> getCustomFeatures()
public com.fasterxml.jackson.databind.module.SimpleModule getCustomModule()
public com.fasterxml.jackson.databind.ObjectMapper getConfig()
public void setConfig(com.fasterxml.jackson.databind.ObjectMapper config)
protected void init()
public String mimeType()
mimeType in interface org.noear.solon.core.serialize.Serializer<String>mimeType in interface ContextSerializer<String>public Class<String> dataType()
dataType in interface org.noear.solon.core.serialize.Serializer<String>public boolean matched(org.noear.solon.core.handle.Context ctx,
String mime)
matched in interface ContextSerializer<String>ctx - 请求上下文mime - 内容类型public String name()
name in interface org.noear.solon.core.serialize.Serializer<String>public String serialize(Object obj) throws IOException
serialize in interface org.noear.solon.core.serialize.Serializer<String>obj - 对象IOExceptionpublic Object deserialize(String data, Type toType) throws IOException
deserialize in interface org.noear.solon.core.serialize.Serializer<String>data - 数据toType - 目标类型IOExceptionpublic void serializeToBody(org.noear.solon.core.handle.Context ctx,
Object data)
throws IOException
serializeToBody in interface ContextSerializer<String>ctx - 请求上下文data - 数据IOExceptionpublic Object deserializeFromBody(org.noear.solon.core.handle.Context ctx, @Nullable Type bodyType) throws IOException
deserializeFromBody in interface ContextSerializer<String>ctx - 请求上下文IOExceptionCopyright © 2025. All rights reserved.