From 05d2a5aa8c962e0e41da509058a391b2f0cb2f16 Mon Sep 17 00:00:00 2001 From: redkale Date: Mon, 19 Aug 2024 11:36:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/convert.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/convert.md b/docs/convert.md index 5c8a16aeb..0bb07afd1 100644 --- a/docs/convert.md +++ b/docs/convert.md @@ -34,7 +34,7 @@ JsonConvert 反序列化decode方法: public T convertFrom(Type type, JsonReader reader); ``` -## Json基本用法 +## JSON基本用法 ```java @Data public class UserRecord { @@ -123,8 +123,6 @@ public class UserSimpleInfo { } - - public class UserInfoServlet extends HttpBaseServlet { @Resource @@ -163,7 +161,8 @@ public class UserInfoServlet extends HttpBaseServlet { ```   Convert 支持带参数构造函数。 - 1. public 带参数的构造函数加上 @ConstructorParameters 注解: + +    1. public 带参数的构造函数加上 @ConstructorParameters 注解: ```java public class UserRecord { @@ -193,7 +192,7 @@ public class UserRecord { } } ``` - 2. 自定义Creator: +    2. 自定义Creator: ```java public class UserRecord { @@ -246,7 +245,8 @@ public class UserRecord { ## 自定义   Convert 支持自定义Decode、Encode。 - 1. 通过ConvertFactory显式的注册: + +    1. 通过ConvertFactory显式的注册: ```java public class FileSimpleCoder extends SimpledCoder { @@ -268,7 +268,7 @@ JsonFactory.root().register(File.class, FileSimpleCoder.instance); BsonFactory.root().register(File.class, FileSimpleCoder.instance); ``` - 2. 通过JavaBean类自定义静态方法自动加载: +    2. 通过JavaBean类自定义静态方法自动加载: ```java public class InnerCoderEntity { @@ -360,7 +360,7 @@ public class InnerCoderEntity { } ``` -## Bson数据格式 +## BSON数据格式   BSON类似Java自带的Serializable, 其格式如下:     1). 基本数据类型: 直接转换成byte[]