获取构造函数采用的所有参数的列表
Get a list of all the arguments a constructor takes
是否可以获取构造函数采用的所有参数的列表?
用参数的名称和类型?
我想自动检查 JSON 的值是否适合用于构建与 class 实例等效的值。
最好没有宏...我已经构建了一些,但我仍然觉得它们很混乱。
必须使用 neko 和 JS,如果重要的话。
谢谢。
我想你想看看 Runtime Type Information (rtti)
From the Haxe Manual: The Haxe compiler generates runtime type information (RTTI) for classes that are annotated or extend classes that are annotated with the @:rtti
metadata. This information is stored as a XML string in a static field __rtti
and can be processed through haxe.rtti.XmlParser. The resulting structure is described in RTTI structure.
备选;如果你想使用宏,这可能是一个好的开始
http://code.haxe.org/category/macros/add-parameters-as-fields.html
是否可以获取构造函数采用的所有参数的列表? 用参数的名称和类型?
我想自动检查 JSON 的值是否适合用于构建与 class 实例等效的值。
最好没有宏...我已经构建了一些,但我仍然觉得它们很混乱。
必须使用 neko 和 JS,如果重要的话。
谢谢。
我想你想看看 Runtime Type Information (rtti)
From the Haxe Manual: The Haxe compiler generates runtime type information (RTTI) for classes that are annotated or extend classes that are annotated with the
@:rtti
metadata. This information is stored as a XML string in a static field__rtti
and can be processed through haxe.rtti.XmlParser. The resulting structure is described in RTTI structure.
备选;如果你想使用宏,这可能是一个好的开始
http://code.haxe.org/category/macros/add-parameters-as-fields.html