Comments (2)
HI,
感谢您的建议。
可以很容易过滤指定字段或类型。除了您提到的serialVersionUID,log
还有 static ,transient , final ,甚至是class持有自身引用,等这类字段都是考虑的情况。
程序目前对这方面的处理还是采用保守策略,有两个原因
1、我想尽量保证对象结构的完整性
2、这个程序设计之初的工作场景是在一个无状态的POJO上。
根据您的建议我会对上面这些场景再整理一下。
我想以 Jackson 库的处理策略为准,即如果Jackson对上面哪些情况会采用 过滤 或 保留,呢么我也会照做。
这么做的好处是如果你发现json结果中出现不应该出现的字段,呢么这个字段也会被送到前端。
待我去Jackson上测试测试,在改进前这个Issue不会被关闭。
from pojo2json.
HI hopana,
你说的没错,调查发现 jackson 策略认为 static的成员不应该与类的实例相关,只与类相关。
下个版本将会过滤掉所有 被static标识的成员变量,这与Jackson序列化行为相同。
这个改进会包含在 release 1.1.4 中,两个工作日内可通过 jetbrains plugins 推送或手动拉取更新。
from pojo2json.
Related Issues (20)
- Add java.util.UUID support HOT 2
- Record classes throw error "Can't find class scope" HOT 2
- 提个建议 HOT 2
- JsonProperties without value generate empty keys in json. HOT 3
- Support for member class HOT 4
- 功能请求:模拟实际使用的随机值 HOT 6
- 可否不直接进入某个类文件,用于支持泛型 HOT 1
- 不进入到类里也能工作-改进建议 HOT 1
- RFC: I want this plugin to integrate with HTTP Client plugin. HOT 3
- Consider adding the possibility of setting max string size for random values HOT 5
- StackOverflow on Idea 2022.2 HOT 4
- 能支持继承的父类class文件吗 HOT 8
- Add sample / fake data values HOT 5
- Backreferences not supported HOT 1
- Support for Jackson for keyname HOT 2
- Intellj This class reference level exceeds maximum limit or has nested references! HOT 2
- Generic is not supported HOT 5
- "This class reference level exceeds maximum limit or has nested references!" HOT 2
- 【@Builder + instance】This class reference level exceeds maximum limit or has nested references! HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pojo2json.