Skip to content

Commit 20345c1

Browse files
committed
add missing jsdoc
1 parent 7088c76 commit 20345c1

File tree

8 files changed

+70
-10
lines changed

8 files changed

+70
-10
lines changed

json-smart/src/main/java/net/minidev/json/JSONAware.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
*/
2323
public interface JSONAware {
2424
/**
25+
* Converts this object to JSON string representation.
26+
*
2527
* @return JSON text
2628
*/
2729
String toJSONString();

json-smart/src/main/java/net/minidev/json/JSONAwareEx.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
*/
2525
public interface JSONAwareEx extends JSONAware {
2626
/**
27+
* Converts this object to JSON string representation with specified compression style.
28+
*
29+
* @param compression the JSON style for formatting
2730
* @return JSON text
2831
*/
2932
String toJSONString(JSONStyle compression);

json-smart/src/main/java/net/minidev/json/JSONNavi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
/**
2525
* A JQuery like Json editor, accessor.
2626
*
27+
* @param <T> the type of the root object
2728
* @since 1.0.9
2829
* @author Uriel Chemouni &lt;[email protected]&gt;
2930
*/

json-smart/src/main/java/net/minidev/json/JSONStreamAware.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
* @author FangYidong &lt;[email protected]&gt;
2424
*/
2525
public interface JSONStreamAware {
26-
/** write JSON string to out. */
26+
/**
27+
* write JSON string to out.
28+
*
29+
* @param out the output to write to
30+
* @throws IOException if I/O error occurs
31+
*/
2732
void writeJSONString(Appendable out) throws IOException;
2833
}

json-smart/src/main/java/net/minidev/json/JSONStreamAwareEx.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
* @author FangYidong &lt;[email protected]&gt;
2424
*/
2525
public interface JSONStreamAwareEx extends JSONStreamAware {
26-
/** write JSON string to out. */
26+
/**
27+
* write JSON string to out.
28+
*
29+
* @param out the output to write to
30+
* @param compression the JSON style for formatting
31+
* @throws IOException if I/O error occurs
32+
*/
2733
void writeJSONString(Appendable out, JSONStyle compression) throws IOException;
2834
}

json-smart/src/main/java/net/minidev/json/writer/DefaultMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
/**
2323
* Simple Reader Class for generic Map
2424
*
25+
* @param <T> the type of object to map
2526
* @author uriel
26-
* @param <T>
2727
*/
2828
public class DefaultMapper<T> extends JsonReaderI<T> {
2929
protected DefaultMapper(JsonReader base) {

json-smart/src/main/java/net/minidev/json/writer/JsonReaderI.java

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public JsonReaderI(JsonReader base) {
4343
* called when json-smart parser meet an object key
4444
*
4545
* @param key key name
46+
* @return a JsonReaderI to handle the object parsing
47+
* @throws ParseException if parsing fails
48+
* @throws IOException if I/O error occurs
4649
*/
4750
public JsonReaderI<?> startObject(String key) throws ParseException, IOException {
4851
throw new RuntimeException(
@@ -53,41 +56,78 @@ public JsonReaderI<?> startObject(String key) throws ParseException, IOException
5356
* called when json-smart parser start an array.
5457
*
5558
* @param key the destination key name, or null.
59+
* @return a JsonReaderI to handle the array parsing
60+
* @throws ParseException if parsing fails
61+
* @throws IOException if I/O error occurs
5662
*/
5763
public JsonReaderI<?> startArray(String key) throws ParseException, IOException {
5864
throw new RuntimeException(ERR_MSG + " startArray in " + this.getClass() + " key=" + key);
5965
}
6066

61-
/** called when json-smart done parsing a value */
67+
/**
68+
* called when json-smart done parsing a value
69+
*
70+
* @param current the current object being built
71+
* @param key the key for the value
72+
* @param value the parsed value
73+
* @throws ParseException if parsing fails
74+
* @throws IOException if I/O error occurs
75+
*/
6276
public void setValue(Object current, String key, Object value)
6377
throws ParseException, IOException {
6478
throw new RuntimeException(ERR_MSG + " setValue in " + this.getClass() + " key=" + key);
6579
}
6680

67-
/** ------------- */
81+
/**
82+
* Gets a value from the current object
83+
*
84+
* @param current the current object
85+
* @param key the key to get the value for
86+
* @return the value associated with the key
87+
*/
6888
public Object getValue(Object current, String key) {
6989
throw new RuntimeException(
7090
ERR_MSG + " getValue(Object current, String key) in " + this.getClass() + " key=" + key);
7191
}
7292

73-
// Object current,
93+
/**
94+
* Gets the type for the specified key
95+
*
96+
* @param key the key to get the type for
97+
* @return the Type associated with the key
98+
*/
7499
public Type getType(String key) {
75100
throw new RuntimeException(
76101
ERR_MSG + " getType(String key) in " + this.getClass() + " key=" + key);
77102
}
78103

79-
/** add a value in an array json object. */
104+
/**
105+
* add a value in an array json object.
106+
*
107+
* @param current the current array object
108+
* @param value the value to add
109+
* @throws ParseException if parsing fails
110+
* @throws IOException if I/O error occurs
111+
*/
80112
public void addValue(Object current, Object value) throws ParseException, IOException {
81113
throw new RuntimeException(
82114
ERR_MSG + " addValue(Object current, Object value) in " + this.getClass());
83115
}
84116

85-
/** use to instantiate a new object that will be used as an object */
117+
/**
118+
* use to instantiate a new object that will be used as an object
119+
*
120+
* @return a new object instance
121+
*/
86122
public Object createObject() {
87123
throw new RuntimeException(ERR_MSG + " createObject() in " + this.getClass());
88124
}
89125

90-
/** use to instantiate a new object that will be used as an array */
126+
/**
127+
* use to instantiate a new object that will be used as an array
128+
*
129+
* @return a new array instance
130+
*/
91131
public Object createArray() {
92132
throw new RuntimeException(ERR_MSG + " createArray() in " + this.getClass());
93133
}
@@ -96,6 +136,9 @@ public Object createArray() {
96136
* Allow a mapper to convert a temporary structure to the final data format.
97137
*
98138
* <p>example: convert an List&lt;Integer&gt; to an int[]
139+
*
140+
* @param current the current object to convert
141+
* @return the converted object
99142
*/
100143
@SuppressWarnings("unchecked")
101144
public T convert(Object current) {

json-smart/src/main/java/net/minidev/json/writer/MapperRemapped.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
/**
1010
* Simple solution to support on read field renaming
1111
*
12+
* @param <T> the type of object to map
1213
* @author uriel
13-
* @param <T>
1414
*/
1515
public class MapperRemapped<T> extends JsonReaderI<T> {
1616
private Map<String, String> rename;

0 commit comments

Comments
 (0)