5353/**可远程调用的函数类
5454 * @author Lemon
5555 */
56- public class APIJSONFunctionParser extends AbstractFunctionParser {
56+ public class APIJSONFunctionParser < T extends Object > extends AbstractFunctionParser < T > {
5757 public static final String TAG = "APIJSONFunctionParser" ;
5858
5959 @ NotNull
@@ -79,23 +79,23 @@ public APIJSONFunctionParser(RequestMethod method, String tag, int version, JSON
7979 public HttpSession getSession () {
8080 return session ;
8181 }
82- public APIJSONFunctionParser setSession (HttpSession session ) {
82+ public APIJSONFunctionParser < T > setSession (HttpSession session ) {
8383 this .session = session ;
8484 return this ;
8585 }
8686
8787 @ Override
88- public APIJSONFunctionParser setMethod (RequestMethod method ) {
88+ public APIJSONFunctionParser < T > setMethod (RequestMethod method ) {
8989 super .setMethod (method );
9090 return this ;
9191 }
9292 @ Override
93- public APIJSONFunctionParser setTag (String tag ) {
93+ public APIJSONFunctionParser < T > setTag (String tag ) {
9494 super .setTag (tag );
9595 return this ;
9696 }
9797 @ Override
98- public APIJSONFunctionParser setVersion (int version ) {
98+ public APIJSONFunctionParser < T > setVersion (int version ) {
9999 super .setVersion (version );
100100 return this ;
101101 }
@@ -283,7 +283,7 @@ public static <T extends Object> JSONObject init(boolean shutdownWhenServerError
283283 if (item .get ("language" ) != null ) {
284284 String language = item .getString ("language" );
285285 if (SCRIPT_EXECUTOR_MAP .get (language ) == null ) {
286- onServerError ("找不到脚本语言 " + language + " 对应的执行引擎!请先依赖相关库并在后端 APIJSONFunctionParser 中注册!" , shutdownWhenServerError );
286+ onServerError ("找不到脚本语言 " + language + " 对应的执行引擎!请先依赖相关库并在后端 APIJSONFunctionParser<T> 中注册!" , shutdownWhenServerError );
287287 }
288288 ScriptExecutor scriptExecutor = SCRIPT_EXECUTOR_MAP .get (language );
289289 scriptExecutor .load (name , scriptMap .get (name ).getString ("script" ));
@@ -337,7 +337,7 @@ protected static void onServerError(String msg, boolean shutdown) throws ServerE
337337 public static void test () throws Exception {
338338 test (null );
339339 }
340- public static void test (APIJSONFunctionParser function ) throws Exception {
340+ public static < T extends Object > void test (APIJSONFunctionParser < T > function ) throws Exception {
341341 int i0 = 1 , i1 = -2 ;
342342 JSONObject request = new JSONObject ();
343343 request .put ("id" , 10 );
@@ -710,14 +710,6 @@ public String getMethodArguments(@NotNull JSONObject curObj, String methodArgsKe
710710 }
711711
712712
713- /**改用 getMethodDefinition
714- */
715- @ Deprecated
716- public String getMethodDefination (@ NotNull JSONObject curObj ) throws IllegalArgumentException {
717- // curObj.put("arguments", removeComment(curObj.getString("methodArgs")));
718- return getMethodDefination (curObj , "method" , "arguments" , "genericType" , "genericExceptions" , "Java" );
719- }
720-
721713 /**获取方法的定义
722714 * @param curObj
723715 * @return
@@ -729,13 +721,6 @@ public String getMethodDefinition(@NotNull JSONObject curObj) throws IllegalArgu
729721 // curObj.put("arguments", removeComment(curObj.getString("methodArgs")));
730722 return getMethodDefinition (curObj , "method" , "arguments" , "genericType" , "genericExceptions" , "Java" );
731723 }
732- /**改用 getMethodDefinition
733- */
734- @ Deprecated
735- public String getMethodDefination (@ NotNull JSONObject curObj , String method , String arguments
736- , String type , String exceptions , String language ) throws IllegalArgumentException {
737- return getMethodDefinition (curObj , method , arguments , type , exceptions , language );
738- }
739724 /**获取方法的定义
740725 * @param curObj
741726 * @param method
0 commit comments