Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8058416

JSON in Java lanaguage

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8u20
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      A DESCRIPTION OF THE REQUEST :
      As usual Java evolves and improves from time to time. I think following feature would be great for future releases of Java

      Ability to pass data in Json format (like java-script) for functions accepting map (and if possible for beans also)

      Giving example is expected behavior

      JUSTIFICATION :
      This will make code more simpler, instead of building map we can directly pass json object.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Say we have method like

            void process(String name, Map<String, Integer> map)

      While invoking this method it would be great to have language feature like

         process("Some name", {
               "key1": 10,
               "key2": 20
         });

      The keys should be validated based on compile time signature of method.

      Similarly it would be great to pass JSON for standard java objects also. Which should use default constructor for initialization. This way the API developer need not worry about giving all the possible or useful constructors. The values may be set using setter/getters.



        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: