Skip to content

Conversation

Shounaks
Copy link
Contributor

@Shounaks Shounaks commented Feb 25, 2024

Issue: #48
Providing Support for java.util.Date, via Extensions.

@Shounaks Shounaks marked this pull request as ready for review February 25, 2024 08:41

public class DateValueReader extends ValueReader {
protected DateValueReader() {
super(Date.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this is not JAva 8 date/time type... so probably should be in core jr-objects?

But also, it needs to support deserialization from Integer numbers (timestamp).

@cowtowncoder
Copy link
Member

cowtowncoder commented Mar 11, 2024

Ok, I think this could use refactoring:

  1. Not sure if java.util.Date handling should be added here: core jr-objects supports it with timestamp; should not simply overwrite it without configurability
  2. No need to add new extension, just extend JacksonJrJavaTimeExtension
  3. No need to add new ReaderWriterProvider, just extend JavaTimeReaderWriterProvider

EDIT: ignore this, see my next note.

@cowtowncoder
Copy link
Member

Oh shoot. I should have read it more carefully: this ONLY adds textual read/write for java.util.Date. I was hoping more support for Java 8 date/time types.

I think addition of more features would be ok but should be part of same extension (not separate one) and require configuration (by default leaving serialization as timestamp) -- it's ok to accept textual value by default tho.
However, there is then the question of how to specify format used, and how to (re)configure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants