Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Here's a new feature I'd find useful...

      When serializing an object graph, I'd like to specify certain objects (that may appear anywhere in the graph) that should be detached at serialization time (i.e not serialized) and then reattached at deserialization time.

      Here's an example.

      class Thing {
      int id;
      DataSource ds;
      }

      Thing t = new Thing();
      t.id = 3;
      t.ds = // lookup some heavyweight SQL DataSource from somewhere

      // Serialization
      XStream xstream = new XStream();
      xstream.attach("myds", ds);
      xstream.toXml(t)

      // Produces...
      <Thing>
      <id>3</id>
      <ds id="myds"/>
      </Thing>

      // Deserialization
      XStream xstream = new XStream();
      xstream.attach("myds", ds); // could be another datasource
      xstream.fromXml(xml)

        People

        • Assignee:
          Unassigned
          Reporter:
          Joe Walnes
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated: