Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a general-purpose Contextualizable interface for all handlers to support #9

Open
cowtowncoder opened this issue Sep 17, 2017 · 1 comment

Comments

@cowtowncoder
Copy link
Member

(or, if need be, more than one)

Currently a small set of handlers can be "contextualized": that is, called with context within Object Graph, as specified by Property for which handler is related. This set mostly consists of serializers and deserializers.

But there are many other handlers, especially ones added via annotations, that do not get a chance to change their behavior based on context. It seems quite doable to allow use of an add-on interface like, say, Contextualizable that would allow (re)configuration in this way.

One interface may or may not be doable, due to:

  • Difference between reading (deserialize) and writing (serialize) taking different context object (DeserializationContext vs SerializerProvider) -- although, they are both subtypes of DatabindContext so maybe this is not a fundamental problem.
  • Are there other kinds of context beyond property-bound one? Class annotations might just take JavaType?
@cowtowncoder
Copy link
Member Author

cowtowncoder commented Jan 24, 2018

Handlers to consider:

  • Converters
  • Custom filters (via @JsonInclude)
  • ValueInstantiators

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

No branches or pull requests

1 participant