Code Monkey home page Code Monkey logo

Comments (8)

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Thank you for reporting this. I'll have a look.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Ah. I think I see what is happening here. What comment is trying to say is that the module auto-registered will be JSR310Module, due to entry in:

src/main/resources/META-INF/services/com.fasterxml.jackson.databind.Module

and that is the default due to legacy reasons. So it is correct in a way, although badly phrased.

I will change this in 3.0 to use the new module.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Updated javadoc a bit; fixed registration for master (3.0.0-SNAPSHOT)

from jackson-modules-java8.

feinstein avatar feinstein commented on July 30, 2024

Yeah, it was a bit badly phrased, but I understood it.

The problem I see is how the github documentation is. It doesn't explain that the legacy version is the one to be registered, it just says that the module can be auto-registered, so people will only know about this if they read the javadoc, the ones copying and pasting from the github website will get the legacy version without knowing.

from jackson-modules-java8.

feinstein avatar feinstein commented on July 30, 2024

The documentation says:

Usage
Registering module
Starting with Jackson 2.2, Modules can be automatically discovered using the Java 6 Service Provider Interface (SPI) feature. You can activate this by instructing an ObjectMapper to find and register all Modules:

ObjectMapper mapper = new ObjectMapper();
mapper.findAndRegisterModules();
You should use this feature with caution as it has performance implications. You should generally create one constant ObjectMapper instance for your entire application codebase to share, or otherwise use one of ObjectMapper's findModules methods and cache the result.

If you prefer to selectively register this module, this is done as follows, without the call to findAndRegisterModules():

ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeModule());
After either of these, functionality is available for all normal Jackson operations.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Oh. I did not check github README, only Javadocs. Thanks for pointing this out.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on July 30, 2024

Updated README as well. Let me know if that still does not make sense, and/or you have suggestions for improvement.

from jackson-modules-java8.

feinstein avatar feinstein commented on July 30, 2024

There's a ; on another line, don't know if this was on purpose to "close" the ObjectMapper create, but besides this, it all looks perfectly clear for me now, thank you for taking the time!

from jackson-modules-java8.

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.