Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Annotations, Converters
    • Labels:
      None

      Description

      A new way to create a converter using the constructor instead the setters and specifying which nodes of the xml you want to use:

      private static class Order {

      private final String buyer;

      protected Order(String buyer)

      { this.buyer = buyer; }

      }

      Converter orderConverter = ConstructorConverter.forType(Order.class)
      .withConstructor(String.class)
      .withAliases("buyer")
      .build();

      xStream.registerConverter(orderConverter);
      Order order = (Order) xStream.fromXML(xml);

      I am attaching the patch implementing that feature

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Leonardo Wolter
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated: