Skip to content

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

@cowtowncoder

Description

@cowtowncoder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions