Skip to content

Commit a131483

Browse files
committed
update Java version
1 parent 97e8d79 commit a131483

File tree

9 files changed

+152
-411
lines changed

9 files changed

+152
-411
lines changed

api/Home.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ 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) -
12-
Contains methods useful for reading and writing data, with a focus on CBOR.
11+
* [com.upokecenter.cbor.CBORDataUtilities](com.upokecenter.cbor.CBORDataUtilities.md) -  
1312

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

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

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

api/com.upokecenter.cbor.CBORDataUtilities.md

Lines changed: 0 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
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-
75
## Methods
86

97
* `static CBORObject ParseJSONNumber​(java.lang.String str)`<br>
10-
Parses a number whose format follows the JSON specification.
118
* `static CBORObject ParseJSONNumber​(java.lang.String str,
129
boolean integersOnly,
1310
boolean positiveOnly)`<br>
@@ -28,39 +25,17 @@ Instead, call ParseJSONNumber(str, jsonoptions) with a JSONOptions that
2825
* `static CBORObject ParseJSONNumber​(java.lang.String str,
2926
int offset,
3027
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.
3428
* `static CBORObject ParseJSONNumber​(java.lang.String str,
3529
int offset,
3630
int count,
3731
JSONOptions options)`<br>
38-
Parses a number whose format follows the JSON specification (RFC 8259) and
39-
converts that number to a CBOR object.
4032
* `static CBORObject ParseJSONNumber​(java.lang.String str,
4133
JSONOptions options)`<br>
42-
Parses a number whose format follows the JSON specification (RFC 8259) and
43-
converts that number to a CBOR object.
4434

4535
## Method Details
4636

4737
### ParseJSONNumber
4838
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-
6439
### ParseJSONNumber
6540
@Deprecated public static CBORObject ParseJSONNumber​(java.lang.String str, boolean integersOnly, boolean positiveOnly)
6641
Deprecated.
@@ -70,23 +45,6 @@ Call the one-argument version of this method instead. If this method
7045
call used integersOnly = true, check that the String does not
7146
contain '.', 'E', or 'e' before calling that version.
7247

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-
9048
### ParseJSONNumber
9149
@Deprecated public static CBORObject ParseJSONNumber​(java.lang.String str, boolean integersOnly, boolean positiveOnly, boolean preserveNegativeZero)
9250
Deprecated.
@@ -98,120 +56,9 @@ Instead, call ParseJSONNumber(str, jsonoptions) with a JSONOptions that
9856
that the String does not contain '.', 'E',
9957
or 'e' before calling that version.
10058

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-
12059
### ParseJSONNumber
12160
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-
14561
### ParseJSONNumber
14662
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-
18163
### ParseJSONNumber
18264
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: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,16 @@
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-
155
## Methods
166

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.
7+
* `CBORException()`<br>
8+
* `CBORException​(java.lang.String message)`<br>
239
* `CBORException​(java.lang.String message,
24-
java.lang.Throwable innerException) CBORException`<br>
25-
Initializes a new instance of the CBORException
26-
class.
10+
java.lang.Throwable innerException)`<br>
2711

2812
## Constructors
2913

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.
14+
* `CBORException()`<br>
15+
* `CBORException​(java.lang.String message)`<br>
3616
* `CBORException​(java.lang.String message,
37-
java.lang.Throwable innerException) CBORException`<br>
38-
Initializes a new instance of the CBORException
39-
class.
17+
java.lang.Throwable innerException)`<br>

pom.xml

Lines changed: 20 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,10 @@
44
<groupId>com.upokecenter</groupId>
55
<artifactId>cbor</artifactId>
66
<packaging>jar</packaging>
7-
<version>4.1.1</version>
7+
<version>4.1.0-SNAPSHOT</version>
88
<name>CBOR (Concise Binary Object Representation)</name>
9-
<description>A Java implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 7049.</description>
9+
<description>A Java implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 7049. </description>
1010
<url>https://github.com/peteroupc/CBOR-Java</url>
11-
<profiles>
12-
<profile>
13-
<id>release</id>
14-
<build>
15-
<plugins>
16-
<plugin>
17-
<groupId>org.apache.maven.plugins</groupId>
18-
<artifactId>maven-gpg-plugin</artifactId>
19-
<version>1.5</version>
20-
<executions>
21-
<execution>
22-
<id>sign-artifacts</id>
23-
<phase>verify</phase>
24-
<goals>
25-
<goal>sign</goal>
26-
</goals>
27-
</execution>
28-
</executions>
29-
</plugin>
30-
<plugin>
31-
<groupId>org.apache.maven.plugins</groupId>
32-
<artifactId>maven-javadoc-plugin</artifactId>
33-
<version>3.0.1</version>
34-
<configuration>
35-
<bottom>CBOR for Java documentation, generated in {currentYear}.</bottom>
36-
<additionalJOptions>
37-
<additionalJOption>-html5</additionalJOption>
38-
</additionalJOptions>
39-
40-
</configuration>
41-
<executions>
42-
<execution>
43-
<id>attach-javadocs</id>
44-
<goals>
45-
<goal>jar</goal>
46-
</goals>
47-
</execution>
48-
</executions>
49-
</plugin>
50-
<plugin>
51-
<groupId>org.apache.maven.plugins</groupId>
52-
<artifactId>maven-source-plugin</artifactId>
53-
<version>2.2.1</version>
54-
<executions>
55-
<execution>
56-
<id>attach-sources</id>
57-
<goals>
58-
<goal>jar-no-fork</goal>
59-
</goals>
60-
</execution>
61-
</executions>
62-
</plugin>
63-
</plugins>
64-
</build>
65-
</profile>
66-
</profiles>
6711
<scm>
6812
<connection>scm:git:https://github.com/peteroupc/CBOR-Java</connection>
6913
<developerConnection>scm:git:https://github.com/peteroupc/CBOR-Java.git</developerConnection>
@@ -82,8 +26,8 @@
8226
</developers>
8327
<properties>
8428
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
85-
<maven.compiler.source>6</maven.compiler.source>
86-
<maven.compiler.target>1.6</maven.compiler.target>
29+
<maven.compiler.source>8</maven.compiler.source>
30+
<maven.compiler.target>1.8</maven.compiler.target>
8731
</properties>
8832
<licenses>
8933
<license>
@@ -100,21 +44,15 @@
10044
<version>3.7.0</version>
10145
<configuration>
10246
<compilerArgs>
103-
<arg>-Xlint:all</arg>
47+
<arg>-Xlint:deprecation</arg>
10448
</compilerArgs>
10549
</configuration>
10650
</plugin>
107-
<plugin>
108-
<groupId>org.sonatype.plugins</groupId>
109-
<artifactId>nexus-staging-maven-plugin</artifactId>
110-
<extensions>true</extensions>
111-
<version>1.6.1</version>
112-
<configuration>
113-
<serverId>ossrh</serverId>
114-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
115-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
116-
</configuration>
117-
</plugin>
51+
<plugin>
52+
<groupId>edu.berkeley.cs.jqf</groupId>
53+
<artifactId>jqf-maven-plugin</artifactId>
54+
<version>1.4</version>
55+
</plugin>
11856
</plugins>
11957
</build>
12058
<distributionManagement>
@@ -124,6 +62,16 @@
12462
</snapshotRepository>
12563
</distributionManagement>
12664
<dependencies>
65+
<dependency>
66+
<groupId>edu.berkeley.cs.jqf</groupId>
67+
<artifactId>jqf-fuzz</artifactId>
68+
<version>1.4</version>
69+
</dependency>
70+
<dependency>
71+
<groupId>com.alibaba</groupId>
72+
<artifactId>fastjson</artifactId>
73+
<version>1.2.25</version>
74+
</dependency>
12775
<dependency>
12876
<groupId>junit</groupId>
12977
<artifactId>junit</artifactId>

0 commit comments

Comments
 (0)