Skip to content

Commit 5821bb2

Browse files
committed
update Java version
1 parent d3bbc65 commit 5821bb2

File tree

8 files changed

+702
-672
lines changed

8 files changed

+702
-672
lines changed

api/Home.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Holds converters to customize the serialization and deserialization behavior
3030
Includes options to control how CBOR objects are converted to JSON.
3131

3232
* [com.upokecenter.cbor.PODOptions](com.upokecenter.cbor.PODOptions.md) -
33-
Options for controlling how certain.NET or Java objects, such as so-called
34-
"plain old data" objects (better known as POCOs in.NET or POJOs in
35-
Java), are converted to CBOR objects.
33+
Options for controlling how certain DotNET or Java objects, such as
34+
so-called "plain old data" objects (better known as POCOs in DotNET or
35+
POJOs in Java), are converted to CBOR objects.
3636

3737
* [com.upokecenter.cbor.CBORNumber.NumberKind](com.upokecenter.cbor.CBORNumber.NumberKind.md) -
3838
Specifies the underlying form of this CBOR number object.

api/com.upokecenter.cbor.CBORObject.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,13 +1872,14 @@ Converts this CBOR object to an object of an arbitrary type. See the
18721872
in which the rules regarding the number of days in each month and
18731873
which years are leap years are the same for all years as they were
18741874
in 1970 (including without regard to transitions from other
1875-
calendars to the Gregorian). For tag 1, CBOR objects that express
1876-
infinity or not-a-number (NaN) are treated as invalid by this
1877-
method.</li> <li>If the type is <code>java.net.URI</code> (or <code>URI</code> in Java),
1878-
returns a URI object if possible.</li> <li>If the type is
1879-
<code>java.util.UUID</code> (or <code>UUID</code> in Java), returns a UUID object if
1880-
possible.</li> <li>Plain-Old-Data deserialization: If the object is
1881-
a type not specially handled above, the type includes a
1875+
calendars to the Gregorian). The string format used in tag 0
1876+
supports only years up to 4 decimal digits long. For tag 1, CBOR
1877+
objects that express infinity or not-a-number (NaN) are treated as
1878+
invalid by this method.</li> <li>If the type is <code>java.net.URI</code> (or
1879+
<code>URI</code> in Java), returns a URI object if possible.</li> <li>If
1880+
the type is <code>java.util.UUID</code> (or <code>UUID</code> in Java), returns a UUID
1881+
object if possible.</li> <li>Plain-Old-Data deserialization: If the
1882+
object is a type not specially handled above, the type includes a
18821883
zero-parameter constructor (default or not), this CBOR object is a
18831884
CBOR map, and the "mapper" parameter (if any) allows this type to be
18841885
eligible for Plain-Old-Data deserialization, then this method checks
@@ -4521,8 +4522,8 @@ Converts this object to a text string in JavaScript object Notation (JSON)
45214522
untagged text strings are converted to JSON strings before writing
45224523
them out (for example, <code>22("Test")</code> is converted to
45234524
<code>"Test"</code> and <code>true</code> is converted to <code>"true"</code>). After
4524-
such conversion, if two or more map keys are identical, this method
4525-
throws a CBORException. The example code given in
4525+
such conversion, if two or more keys for the same map are identical,
4526+
this method throws a CBORException. The example code given in
45264527
<b>PeterO.Cbor.CBORObject.ToJSONString(PeterO.Cbor.JSONOptions)</b>
45274528
can be used to write out certain keys of a CBOR map in a given order
45284529
to a JSON string, or to write out a CBOR object as part of a JSON
@@ -4557,18 +4558,18 @@ Converts this object to a text string in JavaScript object Notation (JSON)
45574558
was created using the NewOrderedMap method. Map keys other than
45584559
untagged text strings are converted to JSON strings before writing
45594560
them out (for example, <code>22("Test")</code> is converted to
4560-
<code>"Test"</code> and <code>true</code> is converted to <code>"true"</code>). If,
4561-
after such conversion, two or more map keys are identical, this
4562-
method throws a CBORException.</li> <li>If a number in the form of
4563-
an arbitrary-precision binary floating-point number has a very high
4564-
binary exponent, it will be converted to a double before being
4561+
<code>"Test"</code> and <code>true</code> is converted to <code>"true"</code>). After
4562+
such conversion, if two or more keys for the same map are identical,
4563+
this method throws a CBORException.</li> <li>If a number in the form
4564+
of an arbitrary-precision binary floating-point number has a very
4565+
high binary exponent, it will be converted to a double before being
45654566
converted to a JSON string. (The resulting double could overflow to
45664567
infinity, in which case the arbitrary-precision binary
45674568
floating-point number is converted to null.)</li> <li>The string
45684569
will not begin with a byte-order mark (U+FEFF); RFC 8259 (the JSON
45694570
specification) forbids placing a byte-order mark at the beginning of
45704571
a JSON string.</li> <li>Byte strings are converted to Base64 URL
4571-
without whitespace or padding by default (see section 4.1 of RFC
4572+
without whitespace or padding by default (see section 3.4.5.3 of RFC
45724573
8949). A byte string will instead be converted to traditional base64
45734574
without whitespace and with padding if it has tag 22, or base16 for
45744575
tag 23. (To create a CBOR object with a given tag, call the

api/com.upokecenter.cbor.PODOptions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
public class PODOptions extends java.lang.Object
44

5-
Options for controlling how certain.NET or Java objects, such as so-called
6-
"plain old data" objects (better known as POCOs in.NET or POJOs in
7-
Java), are converted to CBOR objects.
5+
Options for controlling how certain DotNET or Java objects, such as
6+
so-called "plain old data" objects (better known as POCOs in DotNET or
7+
POJOs in Java), are converted to CBOR objects.
88

99
## Fields
1010

src/main/java/com/upokecenter/cbor/CBORJsonWriter.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ static void WriteJSONStringUnquoted(
2525
sb.WriteString(str, 0, i);
2626
return;
2727
}
28-
// int bufferlen = Math.min(Math.max(4, str.length()), 64);
29-
// byte[] buffer = new byte[bufferlen];
30-
// int bufferpos = 0;
3128
for (; i < str.length(); ++i) {
3229
char c = str.charAt(i);
3330
if (c == '\\' || c == '"') {

src/main/java/com/upokecenter/cbor/CBORObject.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,13 +1501,14 @@ public <T> T ToObject(java.lang.reflect.Type t, PODOptions options) {
15011501
* in which the rules regarding the number of days in each month and
15021502
* which years are leap years are the same for all years as they were
15031503
* in 1970 (including without regard to transitions from other
1504-
* calendars to the Gregorian). For tag 1, CBOR objects that express
1505-
* infinity or not-a-number (NaN) are treated as invalid by this
1506-
* method.</li> <li>If the type is <code>java.net.URI</code> (or <code>URI</code> in Java),
1507-
* returns a URI object if possible.</li> <li>If the type is
1508-
* <code>java.util.UUID</code> (or <code>UUID</code> in Java), returns a UUID object if
1509-
* possible.</li> <li>Plain-Old-Data deserialization: If the object is
1510-
* a type not specially handled above, the type includes a
1504+
* calendars to the Gregorian). The string format used in tag 0
1505+
* supports only years up to 4 decimal digits long. For tag 1, CBOR
1506+
* objects that express infinity or not-a-number (NaN) are treated as
1507+
* invalid by this method.</li> <li>If the type is <code>java.net.URI</code> (or
1508+
* <code>URI</code> in Java), returns a URI object if possible.</li> <li>If
1509+
* the type is <code>java.util.UUID</code> (or <code>UUID</code> in Java), returns a UUID
1510+
* object if possible.</li> <li>Plain-Old-Data deserialization: If the
1511+
* object is a type not specially handled above, the type includes a
15111512
* zero-parameter constructor (default or not), this CBOR object is a
15121513
* CBOR map, and the "mapper" parameter (if any) allows this type to be
15131514
* eligible for Plain-Old-Data deserialization, then this method checks
@@ -5499,8 +5500,8 @@ public CBORObject Set(Object key, Object valueOb) {
54995500
* untagged text strings are converted to JSON strings before writing
55005501
* them out (for example, <code>22("Test")</code> is converted to
55015502
* <code>"Test"</code> and <code>true</code> is converted to <code>"true"</code>). After
5502-
* such conversion, if two or more map keys are identical, this method
5503-
* throws a CBORException. The example code given in
5503+
* such conversion, if two or more keys for the same map are identical,
5504+
* this method throws a CBORException. The example code given in
55045505
* <b>PeterO.Cbor.CBORObject.ToJSONString(PeterO.Cbor.JSONOptions)</b>
55055506
* can be used to write out certain keys of a CBOR map in a given order
55065507
* to a JSON string, or to write out a CBOR object as part of a JSON
@@ -5535,18 +5536,18 @@ public String ToJSONString() {
55355536
* was created using the NewOrderedMap method. Map keys other than
55365537
* untagged text strings are converted to JSON strings before writing
55375538
* them out (for example, <code>22("Test")</code> is converted to
5538-
* <code>"Test"</code> and <code>true</code> is converted to <code>"true"</code>). If,
5539-
* after such conversion, two or more map keys are identical, this
5540-
* method throws a CBORException.</li> <li>If a number in the form of
5541-
* an arbitrary-precision binary floating-point number has a very high
5542-
* binary exponent, it will be converted to a double before being
5539+
* <code>"Test"</code> and <code>true</code> is converted to <code>"true"</code>). After
5540+
* such conversion, if two or more keys for the same map are identical,
5541+
* this method throws a CBORException.</li> <li>If a number in the form
5542+
* of an arbitrary-precision binary floating-point number has a very
5543+
* high binary exponent, it will be converted to a double before being
55435544
* converted to a JSON string. (The resulting double could overflow to
55445545
* infinity, in which case the arbitrary-precision binary
55455546
* floating-point number is converted to null.)</li> <li>The string
55465547
* will not begin with a byte-order mark (U+FEFF); RFC 8259 (the JSON
55475548
* specification) forbids placing a byte-order mark at the beginning of
55485549
* a JSON string.</li> <li>Byte strings are converted to Base64 URL
5549-
* without whitespace or padding by default (see section 4.1 of RFC
5550+
* without whitespace or padding by default (see section 3.4.5.3 of RFC
55505551
* 8949). A byte string will instead be converted to traditional base64
55515552
* without whitespace and with padding if it has tag 22, or base16 for
55525553
* tag 23. (To create a CBOR object with a given tag, call the

src/main/java/com/upokecenter/cbor/PODOptions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.upokecenter.cbor;
22

33
/**
4-
* Options for controlling how certain.NET or Java objects, such as so-called
5-
* "plain old data" objects (better known as POCOs in.NET or POJOs in
6-
* Java), are converted to CBOR objects.
4+
* Options for controlling how certain DotNET or Java objects, such as
5+
* so-called "plain old data" objects (better known as POCOs in DotNET or
6+
* POJOs in Java), are converted to CBOR objects.
77
*/
88
public class PODOptions {
99
/**

0 commit comments

Comments
 (0)