Skip to content

Commit 9bd1f3f

Browse files
committed
add missing jsdoc
1 parent 20345c1 commit 9bd1f3f

File tree

13 files changed

+54
-3
lines changed

13 files changed

+54
-3
lines changed

json-smart-action/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,16 @@
250250
</java>
251251
</configuration>
252252
</plugin>
253+
<plugin>
254+
<groupId>org.apache.maven.plugins</groupId>
255+
<artifactId>maven-install-plugin</artifactId>
256+
<version>3.1.4</version>
257+
</plugin>
258+
<plugin>
259+
<groupId>org.apache.maven.plugins</groupId>
260+
<artifactId>maven-deploy-plugin</artifactId>
261+
<version>3.1.4</version>
262+
</plugin>
253263
</plugins>
254264
</build>
255265
<dependencies>

json-smart-action/src/main/java/net/minidev/json/actions/ElementRemover.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,19 @@
3131
public class ElementRemover {
3232
private Map<String, Object> elementsToRemove;
3333

34+
/** Creates an element remover with the specified elements to remove */
3435
public ElementRemover(Map<String, Object> elementsToRemove) {
3536
this.elementsToRemove =
3637
elementsToRemove == null ? Collections.<String, Object>emptyMap() : elementsToRemove;
3738
}
3839

40+
/** Creates an element remover with the specified JSON object elements to remove */
3941
public ElementRemover(JSONObject elementsToRemove) {
4042
this.elementsToRemove =
4143
elementsToRemove == null ? Collections.<String, Object>emptyMap() : elementsToRemove;
4244
}
4345

46+
/** Removes the specified elements from the given JSON object */
4447
public JSONObject remove(JSONObject objectToClean) {
4548
JSONTraverseAction strategy = new RemoveElementsJsonAction(this.elementsToRemove);
4649
JSONTraverser traversal = new JSONTraverser(strategy);

json-smart-action/src/main/java/net/minidev/json/actions/PathLocator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
* A key to the right of a dot is a direct child of a key to the left of a dot. Keys with a dot in
2424
* their name are not supported.
2525
*
26-
* <p>
27-
*
2826
2927
*/
3028
public class PathLocator {

json-smart-action/src/main/java/net/minidev/json/actions/navigate/CopyPathsAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
* @since 15 March 2016.
2727
*/
2828
public class CopyPathsAction implements JSONNavigateAction {
29+
/** The destination tree for copied paths */
2930
protected JSONObject destTree;
31+
/** The current destination branch */
3032
protected JSONObject destBranch;
33+
/** Stack for tracking destination nodes */
3134
protected Stack<Object> destNodeStack;
3235

3336
@Override

json-smart-action/src/main/java/net/minidev/json/actions/navigate/JSONNavigator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
import net.minidev.json.JSONObject;
66

77
/**
8+
* A navigator that operates on JSON objects and arrays for path-based navigation.
9+
*
810
911
* @since 15 June 2016.
1012
*/
1113
public class JSONNavigator extends TreeNavigator<JSONObject, JSONArray> {
1214

15+
/** Creates a navigator with the specified action and paths */
1316
public JSONNavigator(JSONNavigateAction action, List<String> pathsToNavigate) {
1417
super(action, pathsToNavigate);
1518
}
1619

20+
/** Creates a navigator with the specified action and paths */
1721
public JSONNavigator(JSONNavigateAction action, String... pathsToNavigate) {
1822
super(action, pathsToNavigate);
1923
}

json-smart-action/src/main/java/net/minidev/json/actions/navigate/NavigateAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*
1111
* <p>See package-info for more details
1212
*
13+
* @param <M> the map type that extends Map&lt;String, Object&gt;
14+
* @param <L> the list type that extends List&lt;Object&gt;
1315
1416
* @since 15 June 2016
1517
*/

json-smart-action/src/main/java/net/minidev/json/actions/navigate/TreeNavigator.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@
2323
* <p>To navigate the branch k1.k2 of the object {"k1":{"k2":"v1"}, "k3":{"k4":"v2"}} instantiate
2424
* the navigator like so: new JSONNavigator("k1.k2")
2525
*
26+
* @param <M> the map type that extends Map&lt;String, Object&gt;
27+
* @param <L> the list type that extends List&lt;Object&gt;
2628
2729
* @since 15 June 2016.
2830
*/
2931
public class TreeNavigator<M extends Map<String, Object>, L extends List<Object>> {
32+
/** The list of paths to navigate */
3033
protected List<String> pathsToNavigate;
34+
/** The navigation action to execute */
3135
protected NavigateAction<M, L> action;
36+
/** The path prefix to use */
3237
protected String pathPrefix = "";
3338

39+
/** Creates a tree navigator with the specified action and paths */
3440
public TreeNavigator(NavigateAction<M, L> action, List<String> pathsToNavigate) {
3541
if (action == null) {
3642
throw new IllegalArgumentException("NavigateAction cannot be null");
@@ -39,15 +45,18 @@ public TreeNavigator(NavigateAction<M, L> action, List<String> pathsToNavigate)
3945
this.pathsToNavigate = pathsToNavigate;
4046
}
4147

48+
/** Sets a path prefix for this navigator */
4249
public TreeNavigator<M, L> with(String pathPrefix) {
4350
this.pathPrefix = pathPrefix;
4451
return this;
4552
}
4653

54+
/** Creates a tree navigator with the specified action and paths */
4755
public TreeNavigator(NavigateAction<M, L> action, String... pathsToNavigate) {
4856
this(action, Arrays.asList(pathsToNavigate));
4957
}
5058

59+
/** Navigates the specified object using the configured paths */
5160
public void nav(M object) throws Exception {
5261
if (action.start(object, pathsToNavigate)) {
5362
for (String path : pathsToNavigate) {

json-smart-action/src/main/java/net/minidev/json/actions/path/DotDelimiter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
* @since 31 May2016
99
*/
1010
public class DotDelimiter extends PathDelimiter {
11+
/** The dot delimiter character */
1112
protected static final char DELIM_CHAR = '.';
1213

14+
/** Creates a new dot delimiter */
1315
public DotDelimiter() {
1416
super(DELIM_CHAR);
1517
}

json-smart-action/src/main/java/net/minidev/json/actions/path/PathDelimiter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,41 @@
77
* @since 31 May 2016
88
*/
99
public abstract class PathDelimiter {
10+
/** The delimiter character */
1011
protected char delimChar;
12+
/** The delimiter as a string */
1113
protected String delimStr;
14+
/** Whether to accept delimiter characters in keys */
1215
protected boolean acceptDelimInKey;
1316

17+
/** Creates a path delimiter with the specified character */
1418
public PathDelimiter(char delim) {
1519
this.delimChar = delim;
1620
this.delimStr = String.valueOf(delim);
1721
}
1822

23+
/** Configures whether to accept delimiter characters in node names */
1924
public PathDelimiter withAcceptDelimiterInNodeName(boolean acceptDelimInKey) {
2025
this.acceptDelimInKey = acceptDelimInKey;
2126
return this;
2227
}
2328

29+
/** Checks if the given key is acceptable based on delimiter rules */
2430
public boolean accept(String key) {
2531
if (!acceptDelimInKey && key.contains(delimStr)) return false;
2632
return true;
2733
}
2834

35+
/** Returns the delimiter as a string */
2936
public String str() {
3037
return delimStr;
3138
}
3239

40+
/** Returns the delimiter character */
3341
public char chr() {
3442
return delimChar;
3543
}
3644

45+
/** Returns the regex pattern for this delimiter */
3746
public abstract String regex();
3847
}

json-smart-action/src/main/java/net/minidev/json/actions/traverse/KeysPrintAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import net.minidev.json.JSONObject;
66

77
/**
8+
* A traverse action that prints keys during JSON traversal.
9+
*
810
911
* @since 5/24/16.
1012
*/

0 commit comments

Comments
 (0)