Implementation:APIJSON APIJSON Demo DemoFunctionParser BigData
| Knowledge Sources | |
|---|---|
| Domains | API_Design, Business_Logic |
| Last Updated | 2026-10-14 00:00 GMT |
Overview
Concrete tool for remote function invocation with user-session context and comment-cascade deletion in the APIJSON BigData server variant.
Description
The DemoFunctionParser class (BigData variant) extends APIJSONFunctionParser<Long> and provides remotely callable functions: getCurrentUser, getCurrentUserId, getCurrentUserIdAsList, getCurrentContactIdList, verifyIdList, verifyURLList, deleteCommentOfMoment, deleteChildComment (with recursive child comment ID collection), getIdList, and verifyAccess.
Usage
Use these functions in APIJSON request bodies via the "key()":"functionName()" syntax when the BigData server needs server-side business logic.
Code Reference
Source Location
- Repository: APIJSON_APIJSON_Demo
- File: APIJSON-Java-Server/APIJSONBoot-BigData/src/main/java/apijson/demo/DemoFunctionParser.java
- Lines: 1-250
Signature
public class DemoFunctionParser extends APIJSONFunctionParser<Long> {
public Visitor<Long> getCurrentUser(@NotNull JSONObject current);
public Long getCurrentUserId(@NotNull JSONObject current);
public List<Long> getCurrentUserIdAsList(@NotNull JSONObject current);
public List<Long> getCurrentContactIdList(@NotNull JSONObject current);
public void verifyIdList(@NotNull JSONObject current, @NotNull String idList) throws Exception;
public void verifyURLList(@NotNull JSONObject current, @NotNull String urlList) throws Exception;
public int deleteCommentOfMoment(@NotNull JSONObject current, @NotNull String momentId) throws Exception;
public int deleteChildComment(@NotNull JSONObject current, @NotNull String toId) throws Exception;
public JSONArray getIdList(@NotNull JSONObject current);
public Object verifyAccess(@NotNull JSONObject current) throws Exception;
}
Import
import apijson.demo.DemoFunctionParser;
I/O Contract
See Implementation:APIJSON_APIJSON_Demo_DemoFunctionParser for the I/O contract; the BigData variant provides the same function interface.
Usage Examples
See Implementation:APIJSON_APIJSON_Demo_DemoFunctionParser usage examples.