Skip to content

Commit 5e36884

Browse files
authored
Improved documentation (#30)
1 parent aff0b60 commit 5e36884

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/main/org/hjson/JsonValue.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
* Instances that represent JSON <strong>numbers</strong>, <strong>strings</strong> and
4747
* <strong>boolean</strong> values can be created using the static factory methods
4848
* {@link #valueOf(String)}, {@link #valueOf(long)}, {@link #valueOf(double)}, etc.
49+
* {@link #valueOf(float)} and {@link #valueOf(double)} throw a <strong>NumberFormatException
50+
* </strong> if the input is <strong>Inf</strong> or <strong>NaN</strong>.
4951
* </p>
5052
* <p>
5153
* In order to find out whether an instance of this class is of a certain type, the methods
@@ -224,6 +226,9 @@ public static JsonValue valueOf(long value) {
224226
/**
225227
* Returns a JsonValue instance that represents the given <code>float</code> value.
226228
*
229+
* Throws a <strong>NumberFormatException</strong> if the input parameter
230+
* is <strong>Inf</strong> or <strong>NaN</strong>.
231+
*
227232
* @param value the value to get a JSON representation for
228233
* @return a JSON value that represents the given value
229234
*/
@@ -234,6 +239,9 @@ public static JsonValue valueOf(float value) {
234239
/**
235240
* Returns a JsonValue instance that represents the given <code>double</code> value.
236241
*
242+
* Throws a <strong>NumberFormatException</strong> if the input parameter
243+
* is <strong>Inf</strong> or <strong>NaN</strong>.
244+
*
237245
* @param value the value to get a JSON representation for
238246
* @return a JSON value that represents the given value
239247
*/

0 commit comments

Comments
 (0)