|
1 | 1 |
|
2 |
| -### luaBukkit.helper:isLoadPlugin |
| 2 | +### isLoadPlugin |
3 | 3 | + **Description**: 指定脚本插件是否加载.
|
4 | 4 | + **Return Type**: **boolean**
|
5 | 5 | + **Return Desc**: 如果已经加载则返回true.
|
6 |
| -+ **Usage**: `luaBukkit.helper:isLoadPlugin(id:String)` |
| 6 | ++ **Usage**: `isLoadPlugin(id:String)` |
7 | 7 |
|
8 | 8 | |Name|Type|Description|
|
9 | 9 | |-|-|-|
|
10 | 10 | |id|**String**|脚本插件id|
|
11 |
| -### luaBukkit.helper:newLuaRunnable |
| 11 | +### newLuaRunnable |
12 | 12 | + **Description**: 以指定id对应的函数为run方法主体创建一个Runnable子类实例
|
13 | 13 | + **Return Type**: **LuaRunnable**
|
14 | 14 | + **Return Desc**: LuaRunnable实例
|
15 |
| -+ **Usage**: `luaBukkit.helper:newLuaRunnable(id:String)` |
| 15 | ++ **Usage**: `newLuaRunnable(id:String)` |
16 | 16 |
|
17 | 17 | |Name|Type|Description|
|
18 | 18 | |-|-|-|
|
19 | 19 | |id|**String**|函数路径|
|
20 |
| -### luaBukkit.helper:newLuaRunnable |
| 20 | +### newLuaRunnable |
21 | 21 | + **Description**: 以指定id对应的函数为run方法主体创建一个Runnable子类实例
|
22 | 22 | + **Return Type**: **LuaRunnable**
|
23 | 23 | + **Return Desc**: LuaRunnable实例
|
24 |
| -+ **Usage**: `luaBukkit.helper:newLuaRunnable(id:String, obj:Object)` |
| 24 | ++ **Usage**: `newLuaRunnable(id:String, obj:Object)` |
25 | 25 |
|
26 | 26 | |Name|Type|Description|
|
27 | 27 | |-|-|-|
|
28 | 28 | |id|**String**|函数路径|
|
29 | 29 | |obj|**Object**|带入的参数.|
|
30 |
| -### luaBukkit.helper:getPlugin |
| 30 | +### getPlugin |
31 | 31 | + **Description**: 获取本插件实例对象.
|
32 | 32 | + **Return Type**: **Plugin**
|
33 | 33 | + **Return Desc**: 本插件的实例对象.
|
34 |
| -+ **Usage**: `luaBukkit.helper:getPlugin()` |
| 34 | ++ **Usage**: `getPlugin()` |
35 | 35 |
|
36 | 36 | |Name|Type|Description|
|
37 | 37 | |-|-|-|
|
38 | 38 |
|
39 |
| -### luaBukkit.helper:getClass |
40 |
| -+ **Description**: 通过全类名去获取java类类型. |
41 |
| -+ **Return Type**: **Class<?>** |
42 |
| -+ **Return Desc**: 如果类存在则返回对应的类 |
43 |
| -+ **Usage**: `luaBukkit.helper:getClass(name:String)` |
44 |
| - |
45 |
| -|Name|Type|Description| |
46 |
| -|-|-|-| |
47 |
| -|name|**String**|全类名| |
48 |
| -### luaBukkit.helper:isNativeMode |
| 39 | +### isNativeMode |
49 | 40 | + **Description**: 插件是否在Native模式下运行.
|
50 | 41 | + **Return Type**: **boolean**
|
51 | 42 | + **Return Desc**: 如果是在Native模式下运行则返回true.
|
52 |
| -+ **Usage**: `luaBukkit.helper:isNativeMode()` |
| 43 | ++ **Usage**: `isNativeMode()` |
| 44 | + |
| 45 | +|Name|Type|Description| |
| 46 | +|-|-|-| |
| 47 | + |
| 48 | +### httpAction |
| 49 | ++ **Description**: 以插件身份发送一个HTTP请求. |
| 50 | ++ **Return Type**: **void** |
| 51 | ++ **Return Desc**: |
| 52 | ++ **Usage**: `httpAction(plugin:LuaPlugin, urlString:String, body:byte[], preOperation:Object, callback:Object, errorCallback:Object)` |
| 53 | + |
| 54 | +|Name|Type|Description| |
| 55 | +|-|-|-| |
| 56 | +|plugin|**LuaPlugin**|Lua插件实例.| |
| 57 | +|urlString|**String**|链接字符串| |
| 58 | +|body|**byte[]**|请求体,如果传入null则代表不需要请求体.| |
| 59 | +|preOperation|**Object**|前置操作Lua函数闭包,将会传入一个HttpURLConnection实例给闭包.| |
| 60 | +|callback|**Object**|一个Lua函数闭包,会将ResponseCode以及HTTP请求的文本结果作为字符串传递给闭包.| |
| 61 | +|errorCallback|**Object**|一个Lua函数闭包,其只在运行过程中出现错误时调用,会将Exception实例传给闭包.| |
| 62 | +### httpAction |
| 63 | ++ **Description**: 以插件身份发送一个HTTP请求. |
| 64 | ++ **Return Type**: **void** |
| 65 | ++ **Return Desc**: |
| 66 | ++ **Usage**: `httpAction(plugin:LuaPlugin, urlString:String, method:String, body:byte[], connectTimeout:int, readTimeout:int, instanceFollowRedirects:boolean, Map<String:, header:String>, useCaches:boolean, callback:Object, errorCallback:Object)` |
| 67 | + |
| 68 | +|Name|Type|Description| |
| 69 | +|-|-|-| |
| 70 | +|plugin|**LuaPlugin**|Lua插件实例.| |
| 71 | +|urlString|**String**|链接字符串| |
| 72 | +|method|**String**|请求方法| |
| 73 | +|body|**byte[]**|请求体,如果传入null则代表不需要请求体.| |
| 74 | +|connectTimeout|**int**|连接等待时间(毫秒).| |
| 75 | +|readTimeout|**int**|读取等待时间(毫秒).| |
| 76 | +|instanceFollowRedirects|**boolean**|是否跟随重定向.| |
| 77 | +|Map<String|****|null| |
| 78 | +|header|**String>**|需要添加的请求头,为null则代表不需要添加.| |
| 79 | +|useCaches|**boolean**|是否使用缓存.| |
| 80 | +|callback|**Object**|一个Lua函数闭包,会将ResponseCode以及HTTP请求的文本结果作为字符串传递给闭包.| |
| 81 | +|errorCallback|**Object**|一个Lua函数闭包,其只在运行过程中出现错误时调用,会将Exception实例传给闭包.| |
| 82 | +### httpAction |
| 83 | ++ **Description**: 以插件身份发送一个HTTP请求. |
| 84 | ++ **Return Type**: **void** |
| 85 | ++ **Return Desc**: |
| 86 | ++ **Usage**: `httpAction(plugin:LuaPlugin, urlString:String, method:String, body:String, bodyEncode:String, connectTimeout:int, readTimeout:int, instanceFollowRedirects:boolean, Map<String:, header:String>, useCaches:boolean, callback:Object, errorCallback:Object)` |
| 87 | + |
| 88 | +|Name|Type|Description| |
| 89 | +|-|-|-| |
| 90 | +|plugin|**LuaPlugin**|Lua插件实例.| |
| 91 | +|urlString|**String**|链接字符串| |
| 92 | +|method|**String**|请求方法| |
| 93 | +|body|**String**|字符串请求体,如果传入null则代表不需要请求体.| |
| 94 | +|bodyEncode|**String**|字符串请求体编码格式.| |
| 95 | +|connectTimeout|**int**|连接等待时间(毫秒).| |
| 96 | +|readTimeout|**int**|读取等待时间(毫秒).| |
| 97 | +|instanceFollowRedirects|**boolean**|是否跟随重定向.| |
| 98 | +|Map<String|****|null| |
| 99 | +|header|**String>**|需要添加的请求头,为null则代表不需要添加.| |
| 100 | +|useCaches|**boolean**|是否使用缓存.| |
| 101 | +|callback|**Object**|一个Lua函数闭包,会将ResponseCode以及HTTP请求的文本结果作为字符串传递给闭包.| |
| 102 | +|errorCallback|**Object**|一个Lua函数闭包,其只在运行过程中出现错误时调用,会将Exception实例传给闭包.| |
| 103 | +### httpGet |
| 104 | ++ **Description**: 以插件身份发送一个HTTP的GET请求. |
| 105 | ++ **Return Type**: **void** |
| 106 | ++ **Return Desc**: |
| 107 | ++ **Usage**: `httpGet(plugin:LuaPlugin, urlString:String, connectTimeout:int, readTimeout:int, instanceFollowRedirects:boolean, Map<String:, header:String>, useCaches:boolean, callback:Object, errorCallback:Object)` |
| 108 | + |
| 109 | +|Name|Type|Description| |
| 110 | +|-|-|-| |
| 111 | +|plugin|**LuaPlugin**|Lua插件实例.| |
| 112 | +|urlString|**String**|链接字符串| |
| 113 | +|connectTimeout|**int**|连接等待时间(毫秒).| |
| 114 | +|readTimeout|**int**|读取等待时间(毫秒).| |
| 115 | +|instanceFollowRedirects|**boolean**|是否跟随重定向.| |
| 116 | +|Map<String|****|null| |
| 117 | +|header|**String>**|需要添加的请求头,为null则代表不需要添加.| |
| 118 | +|useCaches|**boolean**|是否使用缓存.| |
| 119 | +|callback|**Object**|一个Lua函数闭包,会将ResponseCode以及HTTP请求的文本结果作为字符串传递给闭包.| |
| 120 | +|errorCallback|**Object**|一个Lua函数闭包,其只在运行过程中出现错误时调用,会将Exception实例传给闭包.| |
| 121 | +### httpGet |
| 122 | ++ **Description**: 以插件身份发送一个HTTP的GET请求. |
| 123 | ++ **Return Type**: **void** |
| 124 | ++ **Return Desc**: |
| 125 | ++ **Usage**: `httpGet(plugin:LuaPlugin, urlString:String, connectTimeout:int, readTimeout:int, instanceFollowRedirects:boolean, useCaches:boolean, callback:Object, errorCallback:Object)` |
53 | 126 |
|
54 | 127 | |Name|Type|Description|
|
55 | 128 | |-|-|-|
|
| 129 | +|plugin|**LuaPlugin**|Lua插件实例.| |
| 130 | +|urlString|**String**|链接字符串| |
| 131 | +|connectTimeout|**int**|连接等待时间(毫秒).| |
| 132 | +|readTimeout|**int**|读取等待时间(毫秒).| |
| 133 | +|instanceFollowRedirects|**boolean**|是否跟随重定向.| |
| 134 | +|useCaches|**boolean**|是否使用缓存.| |
| 135 | +|callback|**Object**|一个Lua函数闭包,会将ResponseCode以及HTTP请求的文本结果作为字符串传递给闭包.| |
| 136 | +|errorCallback|**Object**|一个Lua函数闭包,其只在运行过程中出现错误时调用,会将Exception实例传给闭包.| |
0 commit comments