Giter VIP home page Giter VIP logo

Comments (2)

organics2016 avatar organics2016 commented on May 27, 2024

HI,
感谢您的建议。
可以很容易过滤指定字段或类型。除了您提到的serialVersionUID,log
还有 static ,transient , final ,甚至是class持有自身引用,等这类字段都是考虑的情况。
程序目前对这方面的处理还是采用保守策略,有两个原因
1、我想尽量保证对象结构的完整性
2、这个程序设计之初的工作场景是在一个无状态的POJO上。
根据您的建议我会对上面这些场景再整理一下。
我想以 Jackson 库的处理策略为准,即如果Jackson对上面哪些情况会采用 过滤 或 保留,呢么我也会照做。
这么做的好处是如果你发现json结果中出现不应该出现的字段,呢么这个字段也会被送到前端。

待我去Jackson上测试测试,在改进前这个Issue不会被关闭。

from pojo2json.

organics2016 avatar organics2016 commented on May 27, 2024

HI hopana,
你说的没错,调查发现 jackson 策略认为 static的成员不应该与类的实例相关,只与类相关。
下个版本将会过滤掉所有 被static标识的成员变量,这与Jackson序列化行为相同。

这个改进会包含在 release 1.1.4 中,两个工作日内可通过 jetbrains plugins 推送或手动拉取更新。

from pojo2json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.