当前位置:网站首页>fastjson中@jsonType注解的功能简介说明
fastjson中@jsonType注解的功能简介说明
2022-07-28 09:23:00 【qq_25073223】
转自:
下文笔者讲述@jsonType注解的简介说明,如下所示
@JSONType的功能
@JSONType(includes = {"name","sex"})
@JSONType(ignores ={"id", "sex"})
放在实体类中就会只装配列举的字段,
@JSONField的使用
放在实体类中的某个字段上面
protected class PayConfig {
@JSONField(name = "appId")
private String appId;
}
在实体类上的字段使用
@JSONField定制序列化
//配置序列化的时候,不序列化id @JSONField(serialize=false) private int id; private String name;// 姓名 private int age; //年龄 // 配置序列化的名称 @JSONField(name="gender") public String sex;
在类上通过@JSONType定制序列化
//配置序列化的时候,不序列化id sex
@JSONType(ignores ={"id", "sex"})
public class TestClass Serializable {}
//配置序列化的时候,序列化name 和sex
@JSONType(includes={"name","sex"})
public class TestClass Serializable {}
注意事项:
注意和@JSONField不同的是
@JSONType是配置在类上
@JSONField是配置在字段和方法上边栏推荐
- (iros 2022) monocular visual inertial odometer based on event camera
- Retrofit源码解析
- Seeing clearly is more important than walking fast, because you can go far only when you walk right
- Introduction to shardingsphere's concept of sub database and sub table (2)
- C form application uses object binding DataGridView data binding
- How to learn so many conceptual things in database? Seeking method
- Inside database system distributed system
- 3分钟带你了解微信小程序开发
- 数据库高级学习笔记--游标
- With frequent data leakage and deletion events, how should enterprises build a security defense line?
猜你喜欢

C# 读写文件从用户态切到内核态,到底是个什么流程?

With such a simple verification, 80% of programmers can't do it, let alone understand it!

Create SSL certificate using OpenSSL

使用 OpenSSL 创建ssl证书

SQL Server、MySQL主从搭建,EF Core读写分离代码实现

MATLAB的实时编辑器

Introduction to SD card (based on spec3.0)

WPF布局之控件随着窗口等比放大缩小,适应多分辨率满屏填充应用
![ASP.NET Core 6框架揭秘实例演示[29]:搭建文件服务器](/img/90/40869d7c03f09010beb989af07e2f0.png)
ASP.NET Core 6框架揭秘实例演示[29]:搭建文件服务器

JS array is de duplicated, the ID is the same, and a value is added and merged
随机推荐
ShardingSphere之分库分表概念介绍(二)
【AUTOSAR-RTE】-3-Runnable及其Task Mapping映射
数据库那么多概念性的东西怎么学?求方法
What is cross domain? How to solve the cross domain problem?
咸鱼ESP32实例—MQTT 点亮LED
Database core system
Source code analysis of activityrouter
老板:公司系统太多,能不能实现账号互通?
C# 倒计时工具
网络工程——软科中国大学专业排名
分支与循环(1)
Create SSL certificate using OpenSSL
OpenAtom OpenHarmony分论坛,今天14:00见!附大事记精彩发布
Network engineering -- ranking of Chinese universities in Soft Science
Machine learning (10) -- hypothesis testing and regression analysis
C# 读写文件从用户态切到内核态,到底是个什么流程?
Window source code analysis (IV): window deletion mechanism
SD卡介绍(基于SPEC3.0)
Real time editor of MATLAB
使用Xposed对软件进行破解