XStream
  1. XStream
  2. XSTR-12

Decouple reference loop by adding refids

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The use pattern of XStream looks simple and great.

      It seems to miss the ability to serialize objects that have loops in the object references. A simple mechanism would be to insert refid's into the generated XML and access an existing instance of that object when further uses are encountered.

      The main problem arises due to the fact that when serializing the object for the first time it is not known ahead if it will be referenced again. Either it would need:
      a) a two pass form, where first the objects are scanned and then written out (bad idea)
      b) the XML is written into a DOM, which is then updated when a reference is encountered.
      c) offsets in the output XML string are help and the refid is inserted when encountered.

      Could such a feature find it's way into XStream? Maybe enabled through a configuration switch?

      Cheers,
      Christoph

        People

        • Assignee:
          Unassigned
          Reporter:
          Christoph Reck
        • Votes:
          1 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: