John J. Aylward
adb0478f66
properly unescape tokens in JSONML for reversability.
2016-09-22 16:23:09 -04:00
John J. Aylward
f58a0f4684
fixes code point appends to string builder
2016-09-22 16:10:49 -04:00
John J. Aylward
c11e09959c
Fixes code point output when unescaping code points. XML escapes are an entire code point, not surrogate pairs like in JSON.
2016-09-22 15:40:26 -04:00
John J. Aylward
68f92eb395
Adds more javadoc.
2016-09-22 14:40:39 -04:00
John J. Aylward
34652a8706
Updates to iterate on code points instead of characters and changes the encoding to only encode control characters as defined by ISO standard.
2016-09-22 14:13:14 -04:00
John J. Aylward
a2d3b59394
Implements unicode escaping similar to JSONObject.
...
* 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.
2016-09-22 12:38:06 -04:00
Sean Leary
c24be0e4ea
Merge pull request #274 from johnjaylward/NumberOutputFix
...
Fix for number output bug.
2016-09-09 11:42:35 -05:00
John J. Aylward
88f65c5bea
Merge branch 'master' of github.com:stleary/JSON-java into NumberOutputFix
...
# Conflicts:
# JSONObject.java
2016-08-26 11:32:35 -04:00
Sean Leary
ebe69df8e4
Merge pull request #271 from johnjaylward/EnumCleanup
...
Update enum support to be more fully featured.
2016-08-19 10:28:04 -05:00
John J. Aylward
2f2cd4dfc5
Fix for number output bug.
...
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" }
```
2016-08-17 12:54:30 -04:00
John J. Aylward
349a209df3
Merge remote-tracking branch 'upstream/master' into EnumCleanup
2016-08-15 10:25:27 -04:00
John J. Aylward
7851e9b2e8
revert back changes to Number support
2016-08-15 10:24:38 -04:00
Sean Leary
7232a95c0b
Update JSONObject.java
...
Fixed some typos committed in #249 , since reverted, tracking issue is #263
2016-08-15 01:58:54 -05:00
Sean Leary
f96f505188
Update JSONArray.java
...
Fixed a Javadoc typo, originally fixed in #249 , since reverted. This is to address issue #263
2016-08-15 01:53:08 -05:00
John J. Aylward
91107e3e82
Adds support to JSONObject wrap and write methods to explicitly handle Enums.
...
The new way enums are handled is to always place the actual enum in the
JSONObject/JSONArray. When writing, we always write the actual "name"
of the enum, so even with a toString override on the enum class, the
value remains consistant and compatible with the optEnum/getEnum methods.
The constructor JSONObject(Object) functions the same way as before when
passing an enum and is consistent with other "value" types. For example,
when creating a JSONObject with Long, Boolean, BigDecimal as the constructor
parameter, the value will be treated as a "bean".
2016-08-11 12:22:31 -04:00
Sean Leary
4e8e24d49d
Merge pull request #259 from run2000/appendable_v2
...
JSONWriter uses Appendable (v2)
2016-08-10 21:55:10 -05:00
Sean Leary
f881b61c81
Update XML.java
...
Removed a problematic JavaDoc in the header comment to a deprecated method
2016-08-10 15:35:26 -05:00
Sean Leary
37582a44ad
Update README
2016-08-10 09:13:22 -05:00
Sean Leary
154cfda9aa
Merge pull request #261 from stleary/revert-249-master
...
Revert "reduces the use of unnecessary exceptions"
2016-08-10 09:03:57 -05:00
Sean Leary
45a7decba4
Revert "reduces the use of unnecessary exceptions"
2016-08-09 14:22:06 -05:00
Nicholas Cull
0c157cae75
JSONWriter uses Appendable.
2016-08-08 19:40:10 +10:00
Sean Leary
8e079599c4
Update README
2016-08-07 15:19:44 -05:00
Sean Leary
3080b8beeb
Merge pull request #253 from johnjaylward/OptionalTypeConversion
...
Optional type conversion for XML reading
2016-07-31 21:09:07 -05:00
Sean Leary
2c228ecf1a
Merge pull request #249 from Simulant87/master
...
reduces the use of unnecessary exceptions
2016-07-26 23:04:49 -05:00
Nils Faupel
3890bfae52
reduce the use of unnecessary exceptions
2016-07-19 19:59:30 +02:00
Nils Faupel
abf2963bbe
Revert "reduces the use of unnecessary exceptions"
...
This reverts commit 7627d40d10
.
2016-07-19 19:00:42 +02:00
John J. Aylward
09d37e59b8
Cleans up the JSONML changes and adds similar changes to the XML class
2016-07-18 14:42:21 -04:00
John J. Aylward
93704371bb
Updates to the Javadoc for exceptions
2016-07-18 14:12:06 -04:00
Jakob Stemberger
42e0944708
Brings in changes from PR #70 to be updated to HEAD
2016-07-18 13:45:31 -04:00
Simulant
7627d40d10
reduces the use of unnecessary exceptions
2016-07-08 22:17:05 +02:00
Sean Leary
04181fb6e2
Merge pull request #246 from johnjaylward/LicenseFile
...
Add License file
2016-07-02 13:20:54 -05:00
Sean Leary
239e0b7070
Merge pull request #242 from johnjaylward/issue240
...
Fixes Issue #240
2016-07-02 13:20:21 -05:00
johnjaylward
a8a71898a3
Create LICENSE
2016-06-22 14:49:52 -04:00
johnjaylward
86e8f7b313
Update README
...
fixes typo
2016-06-17 16:39:11 -04:00
John J. Aylward
42791ab12d
Updates README to note that the parser does allow some invalid JSON
2016-06-16 13:01:22 -04:00
johnjaylward
b3abaa5b4c
Merge pull request #1 from stleary/master
...
update from origin
2016-06-16 11:43:05 -04:00
Sean Leary
eb569b58fc
Merge pull request #236 from madsager/master
...
Make nextString throw a JSONException instead of a NumberFormatExcept…
2016-06-07 21:29:02 -05:00
Mads Ager
16a86d73df
Pass in the throwable that caused the error.
2016-06-02 16:11:15 +02:00
Mads Ager
dfa651e777
Make nextString throw a JSONException instead of a NumberFormatException for malformed input.
2016-06-02 15:56:48 +02:00
Sean Leary
612dafc750
Update JSONObject.java
2016-05-20 21:10:17 -05:00
Sean Leary
808320801a
Update JSONArray.java
...
Update version timestamp
2016-05-20 21:09:53 -05:00
Sean Leary
b2bde1f468
Merge pull request #234 from erosb/master
...
fixing stleary/JSON-Java#233
2016-05-20 21:03:06 -05:00
Bence Erős
56be31e7a8
fixing stleary/JSON-Java#233
2016-05-16 14:53:34 +02:00
stleary
9a81b40334
added some JavaDocs
2016-05-14 11:09:51 -05:00
stleary
4a458a9f1c
add timestamps to recent commits, javadocs for JSONObject, JSONArray queryFrom() methods
2016-05-14 09:22:18 -05:00
Sean Leary
8a72509e6e
Merge pull request #222 from erosb/master
...
JSON Pointer implementation
2016-05-13 22:46:52 -05:00
Bence Erős
c044eb14dd
added copying to JSONPointer constructor
2016-05-05 15:59:43 +02:00
Bence Erős
5ae6a66e38
added javadoc & null check in Builder#append(String)
2016-05-03 23:41:51 +02:00
Bence Erős
d833c2d8de
added builder class for JSONPointer, and implemented toString() and toURIFragment()
2016-05-03 23:18:05 +02:00
Sean Leary
f21ffbe189
Update CDL.java
...
Date of last change.
2016-05-02 22:12:29 -05:00