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.
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.
- duplicates
-
JDK-8046390 JEP 198: Light-Weight JSON API
-
- Candidate
-