Skip to content

Allow custom unmarshalling of xml fragments in StaxEventItemReader [BATCH-2357] #1212

Open
@spring-projects-issues

Description

@spring-projects-issues

Krishna Bhamidipati opened BATCH-2357 and commented

Currently, the reader allows for some custom logic in the doRead method via the protected moveCursorToNextFragment method.

It would be convenient to plug-in custom logic for mapping the fragment as well by refactoring the doRead method to call another protected method like below:

protected T mapFragment(FragmentEventReader fragmentReader) {
    T mappedFragment = (T) unmarshaller.unmarshal(StaxUtils.getSource(fragmentReader));
    return mappedFragment;
}

Affects: 3.0.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions