Skip to content

Conversation

@effad
Copy link
Owner

@effad effad commented May 16, 2017

test

Lukas Treyer and others added 30 commits October 4, 2015 23:17
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.
Include latest Maven release information
JSONObject and JSONArray initialization for Map&lt;?,?> and Collection&lt;?>
Update version for #153
Update version for #153
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
John J. Aylward and others added 27 commits August 15, 2016 10:24
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.
* 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
make sure locale independent data is not upper/lowercased incorrectly…
Allow user to invoke query and optQuery ,with a JSONPointer
@effad effad merged commit e480d88 into effad:master May 16, 2017
effad pushed a commit that referenced this pull request Mar 19, 2025
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.