Announcement Announcement Module
Collapse
No announcement yet.
Spring OXM Efficient Marshalling Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring OXM Efficient Marshalling

    In the StaxEventItemReader of Spring OXM we have a moveCursorToNextFragment(....) method which moves the cursor to the next element. In the documentation of the class it says that this method needs to be overriden if we want to deal with composite fragments .

    I have a case where XML is
    <X>
    .....
    <Y></Y>
    <Y></Y>
    <Y></Y>

    </X>

    This Y can even be a million. So fragmentRootElement name is Y.
    However I want to read some attributes of X also. For that doRead() method can be overriden , but for that I need to override the whole class because lot of member variables used in doRead is private.


    fragmentReader.markStartFragment();
    @SuppressWarnings("unchecked")
    T mappedFragment = (T) unmarshaller.unmarshal(newStaxSource(fragmentReade r));
    item = mappedFragment;
    fragmentReader.markFragmentProcessed();


    Any better method.
Working...
X