XStream
  1. XStream
  2. XSTR-558

API call to map inherited classes without generating a class attribute

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.3.1
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      When mapping subtypes, XStream adds a class attribute to identify the class. Often, this is not necessary because the class can be determined from the structure of the XML by a Converter.

      The patch attached to this issue adds a new API call 'convertInheritance' that lets a program associate a Converter or SingleValueConverter with a base class and list of subclasses. XStream will not write the class attribute when marshalling those subclasses, and rely on the Converter to determine the correct subclass to create when unmarshalling.

      An acceptance test is included.

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Nat Pryce
        • Votes:
          5 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: