forked from stleary/JSON-java
-
Notifications
You must be signed in to change notification settings - Fork 1
updating fork #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSONObject(Map<String, ?> map) allows to initialize the JSONObject with a Map<String, String> JSONArray(Collection<?> collection) allows to initialize a JSONArray with a Collection<JSONObject>
wildcard generic types, e.g. Collection<?> instead of Collection<Object>. This was proposed by other pull requests (#111, #112) already. Consider this commit as merge with #111 and #112. JSONArray: - put(Collection<?> value) {...} - put(Map<String, ?> value) {...} - put(int index, Collection<?> value) throws JSONException {...} - put(int index, Map<String, ?> value) throws JSONException {...} JSONObject: - put(String key, Collection<?> value) throws JSONException {...} - put(String key, Map<String, ?> value) throws JSONException {...} Changed all code affected by new JSONObject and JSONArray constructors: JSONObject: - valueToString(Object value) throws JSONException { - value instanceof Map - value instanceof Collection } - wrap(Object object) { - value instanceof Map - value instanceof Collection } - writeValue(Writer writer, Object value, int indentFactor, int indent){ - value instanceof Map - value instanceof Collection }
changed Iterator to foreach loop in JSONArray ctor JSONArray(Collection<?> collection) and JSONObject ctor JSONObject(Map<?,?> map)
Fixes possible NullPointerException in XML.toString(object, tagName)
Setting version date to match commit date.
Properly overrides the Exception class.
… well as a JSONArray.
Include latest Maven release information
JSONObject and JSONArray initialization for Map<?,?> and Collection<?>
Update version for #153
Update version for #153
Update readme for 20151123 release
Two JSONObject constructors incorrectly specify a @throws JSONException tag in the JavaDoc for those constructors. Remove the relevant JavaDoc.
Remove throws JSONException JavaDoc from 2 methods that do not throw this exception.
Update version after merge of #179
java.lang.Number is currently output without any validation. For all java.* Numbers, this is fine, but for custom Number implementations like Complex or Fraction, the resulting JSON output may be invalid.
For example: If a Fraction implementation defines its' toString method as `return numerator + "/" + denominator`, then the resulting JSON output would be something like this:
```json
{ "fraction" : 1/2 }
```
This is not valid JSON.
This commit verifies that the string representation of the number is close to a JSON formatted number by use of the BigDecimal constructor. If the constructor throws a NumberFormatException, then the string value is instead quoted as a string. The example above would instead output like the following:
```json
{ "fraction" : "1/2" }
```
Update enum support to be more fully featured.
…utFix # Conflicts: # JSONObject.java
Fix for number output bug.
* Removes deprecation on XML.stringToValue(). It now provides unescaping for strings to convert XML entities back into values. * New unescape function to handle XML entities -> value conversion.
…he encoding to only encode control characters as defined by ISO standard.
…an entire code point, not surrogate pairs like in JSON.
Provides "#" string evaluation support for JSON Pointer
Bug fixes for XML Encoding and Decoding
Fixed C&P typo
[FIX] Update README
make sure locale independent data is not upper/lowercased incorrectly…
from JSONArray or JSONObject
from JSONArray or JSONObject fix JSONArray
Allow user to invoke query and optQuery ,with a JSONPointer
effad
pushed a commit
that referenced
this pull request
Mar 19, 2025
Added some examples for new-comers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
test