Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4925

JsonBuilder with Writer support would be handy

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.0
    • 1.8.1, 1.9-beta-1
    • groovy-jdk
    • None

    Description

      JsonBuilder currently loads all of the data into an internal Map.

      It would be really nice to have a JsonBuilder which takes a Writer as a constructor parameter, and writes to this writer as the document is constructed.

      Unfortunatly, I think this would either require a rewrite of JsonBuilder, or a new class to handle this situation (StreamingJsonBuilder?)

      Attachments

        1. StreamingJsonBuilder.groovy
          9 kB
          Tim Yates
        2. StreamingJsonBuilderTest.groovy
          10 kB
          Tim Yates

        Activity

          People

            guillaume Guillaume Sauthier
            tim_yates Tim Yates
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: