Skip to content

Commit edaed4c

Browse files
committed
update Java version
1 parent 33db243 commit edaed4c

28 files changed

+1275
-1092
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ project, add the following to the `dependencies` section in your `pom.xml` file:
2525
<dependency>
2626
<groupId>com.upokecenter</groupId>
2727
<artifactId>cbor</artifactId>
28-
<version>4.1.1</version>
28+
<version>4.1.3</version>
2929
</dependency>
3030
```
3131

api/Home.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Interface implemented by classes that convert objects of arbitrary types to
88
Classes that implement this interface can support conversions from CBOR
99
objects to a custom type and back.
1010

11-
* [com.upokecenter.cbor.CBORDataUtilities](com.upokecenter.cbor.CBORDataUtilities.md) -  
11+
* [com.upokecenter.cbor.CBORDataUtilities](com.upokecenter.cbor.CBORDataUtilities.md) -
12+
Contains methods useful for reading and writing data, with a focus on CBOR.
1213

1314
* [com.upokecenter.cbor.CBOREncodeOptions](com.upokecenter.cbor.CBOREncodeOptions.md) -
1415
Specifies options for encoding and decoding CBOR objects.
@@ -41,7 +42,8 @@ Represents a type that a CBOR object can have.
4142
* [com.upokecenter.cbor.JSONOptions.ConversionMode](com.upokecenter.cbor.JSONOptions.ConversionMode.md) -
4243
Specifies how JSON numbers are converted to CBOR when decoding JSON.
4344

44-
* [com.upokecenter.cbor.CBORException](com.upokecenter.cbor.CBORException.md) -  
45+
* [com.upokecenter.cbor.CBORException](com.upokecenter.cbor.CBORException.md) -
46+
Exception thrown for errors involving CBOR data.
4547

4648
* [com.upokecenter.util.DataUtilities](com.upokecenter.util.DataUtilities.md) -
4749
Contains methods useful for reading and writing text strings.

api/com.upokecenter.cbor.CBORDataUtilities.md

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

33
public final class CBORDataUtilities extends java.lang.Object
44

5+
Contains methods useful for reading and writing data, with a focus on CBOR.
6+
57
## Methods
68

79
* `static CBORObject ParseJSONNumber​(java.lang.String str)`<br>
10+
Parses a number whose format follows the JSON specification.
811
* `static CBORObject ParseJSONNumber​(java.lang.String str,
912
boolean integersOnly,
1013
boolean positiveOnly)`<br>
@@ -25,17 +28,39 @@ Instead, call ParseJSONNumber(str, jsonoptions) with a JSONOptions that
2528
* `static CBORObject ParseJSONNumber​(java.lang.String str,
2629
int offset,
2730
int count)`<br>
31+
Parses a number whose format follows the JSON specification (RFC 8259) from
32+
a portion of a text string, and converts that number to a CBOR
33+
object.
2834
* `static CBORObject ParseJSONNumber​(java.lang.String str,
2935
int offset,
3036
int count,
3137
JSONOptions options)`<br>
38+
Parses a number whose format follows the JSON specification (RFC 8259) and
39+
converts that number to a CBOR object.
3240
* `static CBORObject ParseJSONNumber​(java.lang.String str,
3341
JSONOptions options)`<br>
42+
Parses a number whose format follows the JSON specification (RFC 8259) and
43+
converts that number to a CBOR object.
3444

3545
## Method Details
3646

3747
### ParseJSONNumber
3848
public static CBORObject ParseJSONNumber​(java.lang.String str)
49+
Parses a number whose format follows the JSON specification. The method uses
50+
a JSONOptions with all default properties except for a
51+
PreserveNegativeZero property of false.
52+
53+
**Parameters:**
54+
55+
* <code>str</code> - A text string to parse as a JSON string.
56+
57+
**Returns:**
58+
59+
* A CBOR object that represents the parsed number. Returns positive
60+
zero if the number is a zero that starts with a minus sign (such as
61+
"-0" or "-0.0"). Returns null if the parsing fails, including if the
62+
string is null or empty.
63+
3964
### ParseJSONNumber
4065
@Deprecated public static CBORObject ParseJSONNumber​(java.lang.String str, boolean integersOnly, boolean positiveOnly)
4166
Deprecated.
@@ -45,6 +70,23 @@ Call the one-argument version of this method instead. If this method
4570
call used integersOnly = true, check that the String does not
4671
contain '.', 'E', or 'e' before calling that version.
4772

73+
**Parameters:**
74+
75+
* <code>str</code> - A text string to parse as a JSON number.
76+
77+
* <code>integersOnly</code> - If true, no decimal points or exponents are allowed in
78+
the string. The default is false.
79+
80+
* <code>positiveOnly</code> - If true, only positive numbers are allowed (the leading
81+
minus is disallowed). The default is false.
82+
83+
**Returns:**
84+
85+
* A CBOR object that represents the parsed number. Returns positive
86+
zero if the number is a zero that starts with a minus sign (such as
87+
"-0" or "-0.0"). Returns null if the parsing fails, including if the
88+
string is null or empty.
89+
4890
### ParseJSONNumber
4991
@Deprecated public static CBORObject ParseJSONNumber​(java.lang.String str, boolean integersOnly, boolean positiveOnly, boolean preserveNegativeZero)
5092
Deprecated.
@@ -56,9 +98,120 @@ Instead, call ParseJSONNumber(str, jsonoptions) with a JSONOptions that
5698
that the String does not contain '.', 'E',
5799
or 'e' before calling that version.
58100

101+
**Parameters:**
102+
103+
* <code>str</code> - A text string to parse as a JSON number.
104+
105+
* <code>integersOnly</code> - If true, no decimal points or exponents are allowed in
106+
the string. The default is false.
107+
108+
* <code>positiveOnly</code> - If true, the leading minus is disallowed in the string.
109+
The default is false.
110+
111+
* <code>preserveNegativeZero</code> - If true, returns positive zero if the number is
112+
a zero that starts with a minus sign (such as "-0" or "-0.0").
113+
Otherwise, returns negative zero in this case. The default is false.
114+
115+
**Returns:**
116+
117+
* A CBOR object that represents the parsed number. Returns null if the
118+
parsing fails, including if the string is null or empty.
119+
59120
### ParseJSONNumber
60121
public static CBORObject ParseJSONNumber​(java.lang.String str, JSONOptions options)
122+
Parses a number whose format follows the JSON specification (RFC 8259) and
123+
converts that number to a CBOR object.<p>Roughly speaking, a valid
124+
JSON number consists of an optional minus sign, one or more basic
125+
digits (starting with 1 to 9 unless there is only one digit and that
126+
digit is 0), an optional decimal point (".", full stop) with one or
127+
more basic digits, and an optional letter E or e with an optional
128+
plus or minus sign and one or more basic digits (the exponent). A
129+
string representing a valid JSON number is not allowed to contain
130+
white space characters, including spaces.</p>
131+
132+
**Parameters:**
133+
134+
* <code>str</code> - A text string to parse as a JSON number.
135+
136+
* <code>options</code> - An object containing options to control how JSON numbers are
137+
decoded to CBOR objects. Can be null, in which case a JSONOptions
138+
object with all default properties is used instead.
139+
140+
**Returns:**
141+
142+
* A CBOR object that represents the parsed number. Returns null if the
143+
parsing fails, including if the string is null or empty.
144+
61145
### ParseJSONNumber
62146
public static CBORObject ParseJSONNumber​(java.lang.String str, int offset, int count)
147+
Parses a number whose format follows the JSON specification (RFC 8259) from
148+
a portion of a text string, and converts that number to a CBOR
149+
object.<p>Roughly speaking, a valid JSON number consists of an
150+
optional minus sign, one or more basic digits (starting with 1 to 9
151+
unless there is only one digit and that digit is 0), an optional
152+
decimal point (".", full stop) with one or more basic digits, and an
153+
optional letter E or e with an optional plus or minus sign and one
154+
or more basic digits (the exponent). A string representing a valid
155+
JSON number is not allowed to contain white space characters,
156+
including spaces.</p>
157+
158+
**Parameters:**
159+
160+
* <code>str</code> - A text string containing the portion to parse as a JSON number.
161+
162+
* <code>offset</code> - An index, starting at 0, showing where the desired portion of
163+
<code>str</code> begins.
164+
165+
* <code>count</code> - The length, in code units, of the desired portion of <code>
166+
str</code> (but not more than <code>str</code> 's length).
167+
168+
**Returns:**
169+
170+
* A CBOR object that represents the parsed number. Returns null if the
171+
parsing fails, including if the string is null or empty.
172+
173+
**Throws:**
174+
175+
* <code>java.lang.IllegalArgumentException</code> - Either <code>offset</code> or <code>count</code> is less
176+
than 0 or greater than <code>str</code> 's length, or <code>str</code> 's
177+
length minus <code>offset</code> is less than <code>count</code>.
178+
179+
* <code>java.lang.NullPointerException</code> - The parameter <code>str</code> is null.
180+
63181
### ParseJSONNumber
64182
public static CBORObject ParseJSONNumber​(java.lang.String str, int offset, int count, JSONOptions options)
183+
Parses a number whose format follows the JSON specification (RFC 8259) and
184+
converts that number to a CBOR object.<p>Roughly speaking, a valid
185+
JSON number consists of an optional minus sign, one or more basic
186+
digits (starting with 1 to 9 unless there is only one digit and that
187+
digit is 0), an optional decimal point (".", full stop) with one or
188+
more basic digits, and an optional letter E or e with an optional
189+
plus or minus sign and one or more basic digits (the exponent). A
190+
string representing a valid JSON number is not allowed to contain
191+
white space characters, including spaces.</p>
192+
193+
**Parameters:**
194+
195+
* <code>str</code> - A text string to parse as a JSON number.
196+
197+
* <code>offset</code> - An index, starting at 0, showing where the desired portion of
198+
<code>str</code> begins.
199+
200+
* <code>count</code> - The length, in code units, of the desired portion of <code>
201+
str</code> (but not more than <code>str</code> 's length).
202+
203+
* <code>options</code> - An object containing options to control how JSON numbers are
204+
decoded to CBOR objects. Can be null, in which case a JSONOptions
205+
object with all default properties is used instead.
206+
207+
**Returns:**
208+
209+
* A CBOR object that represents the parsed number. Returns null if the
210+
parsing fails, including if the string is null or empty or <code>
211+
count</code> is 0 or less.
212+
213+
**Throws:**
214+
215+
* <code>java.lang.NullPointerException</code> - The parameter <code>str</code> is null.
216+
217+
* <code>java.lang.IllegalArgumentException</code> - Unsupported conversion kind.

api/com.upokecenter.cbor.CBORException.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,38 @@
22

33
public final class CBORException extends java.lang.RuntimeException
44

5+
Exception thrown for errors involving CBOR data. <p>This library may throw
6+
exceptions of this type in certain cases, notably when errors occur,
7+
and may supply messages to those exceptions (the message can be
8+
accessed through the <code>Message</code> property in.NET or the
9+
<code>getMessage()</code> method in Java). These messages are intended to be
10+
read by humans to help diagnose the error (or other cause of the
11+
exception); they are not intended to be parsed by computer programs,
12+
and the exact text of the messages may change at any time between
13+
versions of this library.</p>
14+
515
## Methods
616

7-
* `CBORException()`<br>
8-
* `CBORException​(java.lang.String message)`<br>
17+
* `CBORException() CBORException`<br>
18+
Initializes a new instance of the CBORException
19+
class.
20+
* `CBORException​(java.lang.String message) CBORException`<br>
21+
Initializes a new instance of the CBORException
22+
class.
923
* `CBORException​(java.lang.String message,
10-
java.lang.Throwable innerException)`<br>
24+
java.lang.Throwable innerException) CBORException`<br>
25+
Initializes a new instance of the CBORException
26+
class.
1127

1228
## Constructors
1329

14-
* `CBORException()`<br>
15-
* `CBORException​(java.lang.String message)`<br>
30+
* `CBORException() CBORException`<br>
31+
Initializes a new instance of the CBORException
32+
class.
33+
* `CBORException​(java.lang.String message) CBORException`<br>
34+
Initializes a new instance of the CBORException
35+
class.
1636
* `CBORException​(java.lang.String message,
17-
java.lang.Throwable innerException)`<br>
37+
java.lang.Throwable innerException) CBORException`<br>
38+
Initializes a new instance of the CBORException
39+
class.

0 commit comments

Comments
 (0)