Skip to content

Commit a1adef1

Browse files
committed
Add API docs for version 2.4.1
1 parent 97ba910 commit a1adef1

17 files changed

+12136
-0
lines changed

api/Home.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# API Documentation
2+
3+
* [com.upokecenter.cbor.ICBORConverter<T>](wiki/com.upokecenter.cbor.ICBORConverter) -
4+
Interface implemented by classes that convert objects of arbitrary types to
5+
CBOR objects.
6+
7+
* [com.upokecenter.cbor.ICBORTag](wiki/com.upokecenter.cbor.ICBORTag) -
8+
Implemented by classes that validate CBOR objects belonging to a specific
9+
tag.
10+
11+
* [com.upokecenter.cbor.CBORDataUtilities](wiki/com.upokecenter.cbor.CBORDataUtilities) -
12+
Contains methods useful for reading and writing data, with a focus on CBOR.
13+
14+
* [com.upokecenter.cbor.CBOREncodeOptions](wiki/com.upokecenter.cbor.CBOREncodeOptions) -
15+
Specifies options for encoding and decoding CBOR objects.
16+
17+
* [com.upokecenter.cbor.CBORObject](wiki/com.upokecenter.cbor.CBORObject) -
18+
Represents an object in Concise Binary Object Representation (CBOR) and
19+
contains methods for reading and writing CBOR data.
20+
21+
* [com.upokecenter.cbor.CBORTypeFilter](wiki/com.upokecenter.cbor.CBORTypeFilter) -
22+
Specifies what kinds of CBOR objects a tag can be.
23+
24+
* [com.upokecenter.cbor.CBORType](wiki/com.upokecenter.cbor.CBORType) -
25+
Represents a type that a CBOR object can have.
26+
27+
* [com.upokecenter.cbor.CBORException](wiki/com.upokecenter.cbor.CBORException) -
28+
Exception thrown for errors involving CBOR data.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# com.upokecenter.cbor.CBORDataUtilities
2+
3+
public final class CBORDataUtilities extends Object
4+
5+
Contains methods useful for reading and writing data, with a focus on CBOR.
6+
7+
## Methods
8+
9+
* `static CBORObject ParseJSONNumber(String str)`<br>
10+
Parses a number whose format follows the JSON specification.
11+
* `static CBORObject ParseJSONNumber(String str,
12+
boolean integersOnly,
13+
boolean positiveOnly)`<br>
14+
Parses a number whose format follows the JSON specification (RFC 7159).
15+
* `static CBORObject ParseJSONNumber(String str,
16+
boolean integersOnly,
17+
boolean positiveOnly,
18+
boolean preserveNegativeZero)`<br>
19+
Parses a number whose format follows the JSON specification (RFC 7159).
20+
21+
## Method Details
22+
23+
### ParseJSONNumber
24+
public static CBORObject ParseJSONNumber(String str)
25+
Parses a number whose format follows the JSON specification. See
26+
#ParseJSONNumber(String, integersOnly, parseOnly) for more
27+
information.
28+
29+
**Parameters:**
30+
31+
* <code>str</code> - A string to parse. The string is not allowed to contain white
32+
space characters, including spaces.
33+
34+
**Returns:**
35+
36+
* A CBOR object that represents the parsed number. Returns positive
37+
zero if the number is a zero that starts with a minus sign (such as
38+
"-0" or "-0.0"). Returns null if the parsing fails, including if the
39+
string is null or empty.
40+
41+
### ParseJSONNumber
42+
public static CBORObject ParseJSONNumber(String str, boolean integersOnly, boolean positiveOnly)
43+
Parses a number whose format follows the JSON specification (RFC 7159).
44+
Roughly speaking, a valid number consists of an optional minus sign,
45+
one or more basic digits (starting with 1 to 9 unless the only digit
46+
is 0), an optional decimal point (".", full stop) with one or more
47+
basic digits, and an optional letter E or e with an optional plus or
48+
minus sign and one or more basic digits (the exponent).
49+
50+
**Parameters:**
51+
52+
* <code>str</code> - A string to parse. The string is not allowed to contain white
53+
space characters, including spaces.
54+
55+
* <code>integersOnly</code> - If true, no decimal points or exponents are allowed in
56+
the string.
57+
58+
* <code>positiveOnly</code> - If true, only positive numbers are allowed (the leading
59+
minus is disallowed).
60+
61+
**Returns:**
62+
63+
* A CBOR object that represents the parsed number. Returns positive
64+
zero if the number is a zero that starts with a minus sign (such as
65+
"-0" or "-0.0"). Returns null if the parsing fails, including if the
66+
string is null or empty.
67+
68+
### ParseJSONNumber
69+
public static CBORObject ParseJSONNumber(String str, boolean integersOnly, boolean positiveOnly, boolean preserveNegativeZero)
70+
Parses a number whose format follows the JSON specification (RFC 7159).
71+
Roughly speaking, a valid number consists of an optional minus sign,
72+
one or more basic digits (starting with 1 to 9 unless the only digit
73+
is 0), an optional decimal point (".", full stop) with one or more
74+
basic digits, and an optional letter E or e with an optional plus or
75+
minus sign and one or more basic digits (the exponent).
76+
77+
**Parameters:**
78+
79+
* <code>str</code> - A string to parse. The string is not allowed to contain white
80+
space characters, including spaces.
81+
82+
* <code>integersOnly</code> - If true, no decimal points or exponents are allowed in
83+
the string.
84+
85+
* <code>positiveOnly</code> - If true, only positive numbers are allowed (the leading
86+
minus is disallowed).
87+
88+
* <code>preserveNegativeZero</code> - If true, returns positive zero if the number is
89+
a zero that starts with a minus sign (such as "-0" or "-0.0").
90+
Otherwise, returns negative zero in this case.
91+
92+
**Returns:**
93+
94+
* A CBOR object that represents the parsed number. Returns null if the
95+
parsing fails, including if the string is null or empty.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# com.upokecenter.cbor.CBOREncodeOptions
2+
3+
public final class CBOREncodeOptions extends Object
4+
5+
Specifies options for encoding and decoding CBOR objects.
6+
7+
## Fields
8+
9+
* `static CBOREncodeOptions NoDuplicateKeys`<br>
10+
Disallow duplicate keys when reading CBOR objects from a data stream.
11+
* `static CBOREncodeOptions NoIndefLengthStrings`<br>
12+
Always encode strings with a definite-length encoding.
13+
* `static CBOREncodeOptions None`<br>
14+
No special options for encoding/decoding.
15+
16+
## Methods
17+
18+
* `CBOREncodeOptions And(CBOREncodeOptions o)`<br>
19+
Returns an options object whose flags are shared by this and another options
20+
object.
21+
* `int getValue()`<br>
22+
Gets this options object's value.
23+
* `CBOREncodeOptions Or(CBOREncodeOptions o)`<br>
24+
Combines the flags of this options object with another options object.
25+
26+
## Field Details
27+
28+
### None
29+
public static final CBOREncodeOptions None
30+
No special options for encoding/decoding. Value: 0.
31+
### NoIndefLengthStrings
32+
public static final CBOREncodeOptions NoIndefLengthStrings
33+
Always encode strings with a definite-length encoding. Used only when
34+
encoding CBOR objects. Value: 1.
35+
### NoDuplicateKeys
36+
public static final CBOREncodeOptions NoDuplicateKeys
37+
Disallow duplicate keys when reading CBOR objects from a data stream. Used
38+
only when decoding CBOR objects. Value: 2.
39+
## Method Details
40+
41+
### getValue
42+
public final int getValue()
43+
Gets this options object's value.
44+
45+
**Returns:**
46+
47+
* This options object's value.
48+
49+
### Or
50+
public CBOREncodeOptions Or(CBOREncodeOptions o)
51+
Combines the flags of this options object with another options object.
52+
53+
**Parameters:**
54+
55+
* <code>o</code> - Another CBOREncodeOptions object.
56+
57+
**Returns:**
58+
59+
* A CBOREncodeOptions object.
60+
61+
### And
62+
public CBOREncodeOptions And(CBOREncodeOptions o)
63+
Returns an options object whose flags are shared by this and another options
64+
object.
65+
66+
**Parameters:**
67+
68+
* <code>o</code> - Another CBOREncodeOptions object.
69+
70+
**Returns:**
71+
72+
* A CBOREncodeOptions object.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# com.upokecenter.cbor.CBORException
2+
3+
public class CBORException extends RuntimeException
4+
5+
Exception thrown for errors involving CBOR data.
6+
7+
## Methods
8+
9+
* `CBORException() CBORException`<br>
10+
Initializes a new instance of the CBORException
11+
class.
12+
* `CBORException(String message) CBORException`<br>
13+
Initializes a new instance of the CBORException
14+
class.
15+
* `CBORException(String message,
16+
Throwable innerException) CBORException`<br>
17+
Initializes a new instance of the CBORException
18+
class.
19+
20+
## Constructors
21+
22+
* `CBORException() CBORException`<br>
23+
Initializes a new instance of the CBORException
24+
class.
25+
* `CBORException(String message) CBORException`<br>
26+
Initializes a new instance of the CBORException
27+
class.
28+
* `CBORException(String message,
29+
Throwable innerException) CBORException`<br>
30+
Initializes a new instance of the CBORException
31+
class.

0 commit comments

Comments
 (0)