All Projects → LiushuiXiaoxia → SerializedNameGen

LiushuiXiaoxia / SerializedNameGen

Licence: Apache-2.0 License
Auto add or remove json annotation plugin, such as gson SerializedName, fastjson JSONField, jackson JsonProperty. It also support java and kotlin file.

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to SerializedNameGen

Easyjson
Provides an unified JSON access API, you can adapter any JSON library to Gson, Jackson, FastJson with easyjson。 提供了一个JSON门面库,就像slf4j一样。easyjson本身不做json的操作,完全依赖于底层实现库。可以直接使用Easyjson的API,底层的JSON库随时可切换。也可以使用其中某个json的API,然后通过easyjson适配给其他的json库
Stars: ✭ 54 (+184.21%)
Mutual labels:  gson, jackson, fastjson
Jsontokotlinclass
🚀 Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )
Stars: ✭ 2,438 (+12731.58%)
Mutual labels:  gson, jackson, fastjson
Jsonschema2pojo
Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
Stars: ✭ 5,633 (+29547.37%)
Mutual labels:  gson, jackson
Javacodeaudit
Getting started with java code auditing 代码审计入门的小项目
Stars: ✭ 289 (+1421.05%)
Mutual labels:  jackson, fastjson
Immutables
Annotation processor to create immutable objects and builders. Feels like Guava's immutable collections but for regular value objects. JSON, Jackson, Gson, JAX-RS integrations included
Stars: ✭ 3,031 (+15852.63%)
Mutual labels:  gson, jackson
Rxcache
A local reactive cache for Java and Android. Now, it supports heap memory、off-heap memory and disk cache.
Stars: ✭ 102 (+436.84%)
Mutual labels:  gson, fastjson
jackson-dynamic-filter
An easy way to determine filters dynamically using Jackson
Stars: ✭ 35 (+84.21%)
Mutual labels:  gson, jackson
spring-rest-2-ts
spring rest 2 ts is typescript generator which produces data model and services in typescript based on Spring MVC annotations. It supports generation for Angular and React
Stars: ✭ 59 (+210.53%)
Mutual labels:  gson, jackson
methanol
⚗️ Lightweight HTTP extensions for Java
Stars: ✭ 172 (+805.26%)
Mutual labels:  gson, jackson
smpe-admin
SMPE-ADMIN后端通用开发框架
Stars: ✭ 42 (+121.05%)
Mutual labels:  fastjson
skinny-micro
🎤 Micro Web framework to build Servlet applications in Scala, the core part of Skinny Framework 2
Stars: ✭ 57 (+200%)
Mutual labels:  jackson
FlickOff
A lite movie guide app, with MVVM architecture, that lets you discover movies from TMDb.
Stars: ✭ 31 (+63.16%)
Mutual labels:  gson
udacity-baking-recipes
Udacity - Baking Android App
Stars: ✭ 14 (-26.32%)
Mutual labels:  jackson
jsonschema-generator
Java JSON Schema Generator – creating JSON Schema (Draft 6, Draft 7, Draft 2019-09, or Draft 2020-12) from Java classes
Stars: ✭ 213 (+1021.05%)
Mutual labels:  jackson
MVVM-Demo
This demo for MVVM Design pattern for android
Stars: ✭ 20 (+5.26%)
Mutual labels:  gson
protostuff-example
Experimenting protostuff
Stars: ✭ 13 (-31.58%)
Mutual labels:  jackson
Coronavirus
Java API Wrapper for tracking coronavirus (COVID-19, SARS-CoV-2) via https://git.io/Jvoep
Stars: ✭ 16 (-15.79%)
Mutual labels:  gson
Kriptofolio
Free open source minimalistic cryptocurrencies portfolio app for Android.
Stars: ✭ 79 (+315.79%)
Mutual labels:  gson
PlayAndroid
✌️✊👋玩安卓Mvvm组件化客户端,整合Jetpack组件DataBinding、ViewModel以及LiveData;屏幕适配✔️状态栏沉浸式✔️黑夜模式✔️,无数据、加载失败状态页;骨架屏、Koin依赖注入等
Stars: ✭ 193 (+915.79%)
Mutual labels:  gson
nakadi-java
🌀 Client library for the Nakadi Event Broker (examples: http://bit.ly/njc-examples, site: https://dehora.github.io/nakadi-java/)
Stars: ✭ 29 (+52.63%)
Mutual labels:  gson

Gson SerializedName Gen


GsonSerializedNameGen 是一个自动生成Gson SerializedName注解的插件。

IEDA插件仓库地址

插件下载地址

插件Github地址

介绍

有时候经常会维护一些老的项目,可能由于历史或开发人员能力问题,代码会稍微不规范。

比如在请求网络数据时会需要把json反序列化成实体,然后下面是常见的一种方式。

public class Bean {

    public String Name;

    public int max_age;
    
    public class InnerA {

        public String Name;

        public int max_age;
    }

    public static class InnerB {

        public String Name;

        public int max_age;
    }
}

上面的代码是很规范的,首先代码中字段名字命名规则是不满足驼峰规则的,其次需要添加json别名注解,比如常见的Gson,需要添加@SerializedName注解,否则不能进行代码混淆。

一些有强迫症的程序员就会手动修改这些代码,但是是历史代码,可能一不小心就改坏了,修改需要一定的工作量,并且是重复劳动的工作,那么此工具就是干这样的事情的,使用工具优化后,就变成了下面样子。

public class Bean {

    @SerializedName("Name")
    public String Name;

    @SerializedName("max_age")
    public int max_age;
    
    public class InnerA {

        @SerializedName("Name")
        public String Name;

        @SerializedName("max_age")
        public int max_age;
    }

    public static class InnerB {

        @SerializedName("Name")
        public String Name;

        @SerializedName("max_age")
        public int max_age;
    }
}

使用姿势

支持特性

  • 支持Gson SerializedName 注解添加与删除
  • 支持Fastjson JSONField 注解添加与删除
  • 支持Jackson JsonProperty 注解添加与删除
  • 支持Java & Kotlin语言

插件下载

IEDA插件仓库地址

插件下载地址

搜索 SerializedName Tool

插件安装

示例演示

示例演示

规则配置

示例演示

其他

第一个版本,实现有点仓促,如果有问题,欢迎交流,[email protected]

后续规划

  • 支持Kotlin语言
  • 支持删除某一种json序列化工具别名
  • 支持其他方式json序列化工具

其他工具

SerializedNameGen

AutoValueConvert

DatabindingConvert

日志

v0.8

  • 添加FirstUppercase生成规则
  • 生成规则
    • Origin
    • Uppercase
    • FirstUppercase
    • Lowercase
    • Underline
    • Smart

v0.7

  • 支持生成规则配置
  • 生成规则
    • Origin
    • Uppercase
    • Lowercase
    • Underline
    • Smart

v0.4

  • 支持Gson SerializedName 注解添加与删除
  • 支持Fastjson JSONField 注解添加与删除
  • 支持Jackson JsonProperty 注解添加与删除
  • 支持Java & Kotlin语言

v0.3

  • 支持 Gson SerializedName 的删除

v0.2

  • 优化代码

v0.1

  • 第一个版本,实现基本功能,支持添加Gson SerializedName
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].