-
Notifications
You must be signed in to change notification settings - Fork 115
API文档_Android_Java_LuaExclude
vimfung edited this page Nov 19, 2018
·
1 revision
该类型主要对导出到lua中的类型进行注解,告诉框架原生类型那些属性、方法是不被导出到lua中的。用于控制lua对原生类型的访问权限。在需要排除的方法或属性中加入该注解即可实现导出限制。
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@interface LuaExclude;
下例演示了如何限制Person
类的age
属性和walk
方法导出到lua中
public class Person implements LuaExportType
{
public String name;
@LuaExclude
public int age;
public void say(String text)
{
Log.v("lsc", String.format("%s say: %s", name, text));
}
@LuaExclude
public void walk()
{
Log.v("lsc", String.format("%s walk", name));
}
public static Person createPerson()
{
return new Person();
}
}