Class NativeFunction
-
- All Implemented Interfaces:
-
com.skillw.asahi.api.script.linking.Invoker
public abstract class NativeFunction implements Invoker
Native function
Asahi内的函数
-
-
Field Summary
Fields Modifier and Type Field Description private final Integer
paramCount
private final String
key
private final Array<String>
paramNames
private final AsahiCompiledScript
content
-
Constructor Summary
Constructors Constructor Description NativeFunction(String key, Array<String> paramNames, AsahiCompiledScript content)
Create empty Native function
-
Method Summary
Modifier and Type Method Description abstract Integer
getParamCount()
Param count final String
getKey()
函数名 final Array<String>
getParamNames()
参数名 final AsahiCompiledScript
getContent()
执行内容 abstract Object
invoke(AsahiContext context, Object params)
调用此函数 String
toString()
final static NativeFunction
create(String key, Array<String> paramNames, AsahiCompiledScript content, Function1<AsahiContext, Unit> initial)
final static NativeFunction
deserialize(String key, String content, String namespaces)
final static NativeFunction
deserialize(String key, Map<String, Object> map, String namespaces)
-
-
Constructor Detail
-
NativeFunction
NativeFunction(String key, Array<String> paramNames, AsahiCompiledScript content)
Create empty Native function
-
-
Method Detail
-
getParamCount
abstract Integer getParamCount()
Param count
-
getParamNames
final Array<String> getParamNames()
参数名
-
getContent
final AsahiCompiledScript getContent()
执行内容
-
invoke
abstract Object invoke(AsahiContext context, Object params)
调用此函数
- Parameters:
context
- 上下文params
- 参数- Returns:
结果
-
create
final static NativeFunction create(String key, Array<String> paramNames, AsahiCompiledScript content, Function1<AsahiContext, Unit> initial)
-
deserialize
final static NativeFunction deserialize(String key, String content, String namespaces)
-
deserialize
final static NativeFunction deserialize(String key, Map<String, Object> map, String namespaces)
-
-
-
-