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

Allocate TokenBuffer instance via context objects (to allow format-specific buffer types) #2989

Closed
cowtowncoder opened this issue Dec 17, 2020 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Dec 17, 2020

It turns out that buffering of token streams cannot always be done without some format-specific additions. For example:

  • XML module may need to retain information on "attribute-ness", namespace(s); possible "unwrapped" Collection types
  • Ion and Avro probably have additional concepts that may need to retain

But currently databind will explicitly construct format-agnostic TokenBuffer, which can support some aspects (native type, object ids) but with added overhead and complexity.

It should be relatively easy, however, to (eventually?) allow format modules to override this selection: the way to do that would be to first make allocations of buffer instances go through:

  • DeserializationContext (for deserialization)
  • SerializerProvider (for serialization)

and then format module may override one or both as necessary (XML module already overrides both, for example); or, if this becomes more widely necessary, context objects can offer other means of pluggability.
Either way, the first step is to add this one redirection.

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

No branches or pull requests

1 participant