Pivot
  1. Pivot
  2. PIVOT-521

Add support for binding JSON structures to Java Beans

    Details

      Activity

      Hide
      Greg Brown added a comment -

      Originally, bean binding was implemented in the JSON class, and beans could be bound to an existing JSON object hierarchy. However, this required traversing the hierarchy twice - once to load it from the JSON file and again to bind it to the bean. Binding is now performed in JSONSerializer directly, such that the hierarchy only needs to be traversed once. The caller passes a class representing the desired output type to the JSONSerializer constructor.

      However, this argument conflicted with the previous "immutable" constructor argument. Since bean binding is likely to be a more valuable feature than immutable collection output, the latest code eliminates the immutable flag in favor of bean binding support.

      Show
      Greg Brown added a comment - Originally, bean binding was implemented in the JSON class, and beans could be bound to an existing JSON object hierarchy. However, this required traversing the hierarchy twice - once to load it from the JSON file and again to bind it to the bean. Binding is now performed in JSONSerializer directly, such that the hierarchy only needs to be traversed once. The caller passes a class representing the desired output type to the JSONSerializer constructor. However, this argument conflicted with the previous "immutable" constructor argument. Since bean binding is likely to be a more valuable feature than immutable collection output, the latest code eliminates the immutable flag in favor of bean binding support.

        People

        • Assignee:
          Greg Brown
          Reporter:
          Greg Brown
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development