从Haxe 3.0开始,你可以运行 --help-metas 来获得定义的编译器元数据的列表。
全局元数据:
| 元数据 | 描述 | 平台 |
| -- | -- | -- |
|@:abi|Function ABI/calling convention| cpp|
|@:abstract|Sets the underlying class implementation as abstract type| cs java|
|@:access (Target path)|Forces private access to package type or field, see Access Control| all|
|@:allow (Target path) |Allows private access from package type or field, see Access Control |all|
|@:analyzer |Used to configure the static analyzer |all|
|@:annotation |Annotation (@interface) definitions on -java-lib imports will be annotated with this metadata. Has no effect on types compiled by Haxe|java|
|@:arrayAccess |Allows Array access on an abstract |all|
|@:autoBuild (Build macro call) |Extends @:build metadata to all extending and implementing classes. See Macro autobuild |all|
|@:bind |Override Swf class declaration |flash|
|@:bitmap (Bitmap file path) |\_Embeds given bitmap data into the class (must extend flash.display.BitmapData) |flash|
|@:bridgeProperties |Creates native property bridges for all Haxe properties in this class |cs|
|@:build (Build macro call) |Builds a class or enum from a macro. See Type Building |all|
|@:buildXml |Specify xml data to be injected into Build.xml |cpp|
|@:callable |Abstract forwards call to its underlying type |all|
|@:classCode |Used to inject platform-native code into a class |cs java|
|@:commutative |Declares an abstract operator as commutative |all|
|@:compilerGenerated |Marks a field as generated by the compiler. Shouldn't be used by the end user |cs java|
|@:coreApi |Identifies this class as a core api class (forces Api check) |all|
|@:coreType |Identifies an abstract as core type so that it requires no implementation |all|
|@:cppFileCode |Code to be injected into generated cpp file |cpp|
|@:cppInclude |File to be included in generated cpp file |cpp|
|@:cppNamespaceCode||cpp|
|@:dce |Forces Dead Code Elimination even when not -dce full is specified |all|
|@:debug |Forces debug information to be generated into the Swf even without -debug |flash|
|@:decl ||cpp|
|@:defParam || all|
|@:delegate |Automatically added by -net-lib on delegates |cs|
|@:depend || cpp|
|@:deprecated |Automatically added by -java-lib on class fields annotated with @Deprecated annotation. Has no effect on types compiled by Haxe |java|
|@:event |Automatically added by -net-lib on events. Has no effect on types compiled by Haxe |cs|
|@:enum |Defines finite value sets to abstract definitions. See enum abstracts |all|
|@:expose (?Name=Class path) |Makes the class available on the window object or exports for node.js. See exposing Haxe classes for JavaScript |js|
|@:extern |Marks the field as extern so it is not generated |all|
|@:fakeEnum (Type name) |Treat enum as collection of values of the specified type |all|
|@:file(File path) |Includes a given binary file into the target Swf and associates it with the class (must extend flash.utils.ByteArray) |flash|
|@:final |Prevents a class from being extended |all|
|@:font (TTF path Range String)|Embeds the given TrueType font into the class (must extend flash.text.Font) |flash|
|@:forward (List of field names) |Forwards field access to underlying type |all|
|@:from |Specifies that the field of the abstract is a cast operation from the type identified in the function. See Implicit Casts |all|
|@:functionCode || cpp|
|@:functionTailCode || cpp|
|@:generic |Marks a class or class field as generic so each type parameter combination generates its own type/field |all|
|@:genericBuild |Builds instances of a type using the specified macro |all|
|@:getter (Class field name)|Generates a native getter function on the given field |flash|
|@:hack |Allows extending classes marked as @:final| all|
|@:headerClassCode |Code to be injected into the generated class, in the header |cpp|
|@:headerCode |Code to be injected into the generated header file |cpp|
|@:headerNamespaceCode | |cpp|
|@:hxGen |Annotates that an extern class was generated by Haxe |cs java|
|@:ifFeature (Feature name) |Causes a field to be kept by DCE if the given feature is part of the compilation |all|
|@:include || cpp|
|@:initPackage || all|
|@:internal |Generates the annotated field/class with internal access |cs java|
|@:isVar |Forces a physical field to be generated for properties that otherwise would not require one |all|
|@:javaCanonical (Output type package,Output type name) |Used by the Java target to annotate the canonical path of the type |java|
|@:jsRequire |Generate javascript module require expression for given extern |js|
|@:keep |Causes a field or type to be kept by DCE |all|
|@:keepInit |Causes a class to be kept by DCE even if all its field are removed |all|
|@:keepSub |Extends @:keep metadata to all implementing and extending classes |all|
|@:macro |(deprecated)| all|
|@:mergeBlock |Merge the annotated block into the current scope |all|
|@:meta |Internally used to mark a class field as being the metadata field |all|
|@:multiType (Relevant type parameters) |Specifies that an abstract chooses its this-type from its @:to functions |all|
|@:native (Output type path) |Rewrites the path of a class or enum during generation |all|
|@:nativeChildren |Annotates that all children from a type should be treated as if it were an extern definition - platform native |cs java|
|@:nativeGen |Annotates that a type should be treated as if it were an extern definition - platform native |cs java|
|@:nativeProperty |Use native properties which will execute even with dynamic usage |cpp|
|@:noCompletion |Prevents the compiler from suggesting completion on this field |all|
|@:noDebug |Does not generate debug information into the Swf even if -debug is set |flash|
|@:noDoc |Prevents a type from being included in documentation generation |all|
|@:noImportGlobal |Prevents a static field from being imported with import Class.* |all|
|@:noPrivateAccess |Disallow private access to anything for the annotated expression |all|
|@:noStack || cpp|
|@:noUsing |Prevents a field from being used with using |all|
|@:nonVirtual |Declares function to be non-virtual |cpp|
|@:notNull |Declares an abstract type as not accepting null values |all|
|@:ns |Internally used by the Swf generator to handle namespaces |flash|
|@:op (The operation) |Declares an abstract field as being an operator overload |all|
|@:optional |Marks the field of a structure as optional. See Optional Arguments |all|
|@:overload (Function specification) |Allows the field to be called with different argument types. Function specification cannot be an expression |all|
|@:privateAccess |Allow private access to anything for the annotated expression |all|
|@:property |Marks a property field to be compiled as a native C# property |cs|
|@:protected |Marks a class field as being protected |all|
|@:public |Marks a class field as being public |all|
|@:publicFields |Forces all class fields of inheriting classes to be public |all|
|@:pythonImport |Generates python import statement for extern classes |python|
|@:readOnly |Generates a field with the readonly native keyword |cs|
|@:remove |Causes an interface to be removed from all implementing classes before generation |all|
|@:require (Compiler flag to check) |Allows access to a field only if the specified compiler flag is set |all|
|@:rtti |Adds runtime type informations. See RTTI |all|
|@:runtime || all|
|@:runtimeValue |Marks an abstract as being a runtime value |all|
|@:selfCall |Translates method calls into calling object directly |js|
|@:setter (Class field name) |Generates a native setter function on the given field |flash|
|@:sound (File path) |Includes a given .wav or .mp3 file into the target Swf and associates it with the class (must extend flash.media.Sound) |flash|
|@:sourceFile |Source code filename for external class |cpp|
|@:strict |Used to declare a native C# attribute or a native Java metadata. Is type checked |cs java|
|@:struct |Marks a class definition as a struct |cs|
|@:structAccess |Marks an extern class as using struct access('.') not pointer('->') |cpp|
|@:suppressWarnings |Adds a SuppressWarnings annotation for the generated Java class |java|
|@:throws (Type as String) |Adds a throws declaration to the generated function |java|
|@:to |Specifies that the field of the abstract is a cast operation to the type identified in the function. See Implicit Casts |all|
|@:transient |Adds the transient flag to the class field |java|
|@:unbound |Compiler internal to denote unbounded global variable |all|
|@:unifyMinDynamic |Allows a collection of types to unify to Dynamic |all|
|@:unreflective || cpp|
|@:unsafe |Declares a class or a method with the C#'s unsafe flag |cs|
|@:usage || all|
|@:value |Used to store default values for fields and function arguments |all|
|@:void |Use Cpp native 'void' return type |cpp|
|@:volatile || cs java|
- 空白目录
- 1.Haxe介绍
- 1.1.Haxe是什么
- 1.2.关于本文档
- 1.2.1.作者及贡献者
- 1.2.2.License
- 1.3Hello World
- 1.4.Haxe的历史
- 2.类型
- 2.1.基本类型
- 2.1.1.数值类型
- 2.1.2.溢出
- 2.1.3.数值运算符
- 2.1.4.Bool类型
- 2.1.5.Void类型
- 2.2.为空性
- 2.2.1.可选参数和为空性
- 2.3.类实例
- 2.3.1.类的构造函数
- 2.3.2.继承
- 2.3.3.接口
- 2.4.枚举实例
- 2.4.1.Enum构造函数
- 2.4.2.使用枚举
- 2.5.匿名结构
- 2.5.1.结构值的JSON形式
- 2.5.2. 结构类型的类记法
- 2.5.3.可选字段
- 2.5.4.性能影响
- 2.6.函数类型
- 2.6.1.可选参数
- 2.6.2.默认值
- 2.7.动态类型
- 2.7.1.Dynamic使用类型参数
- 2.7.2.实现Dynamic
- 2.8.抽象类型
- 2.8.1.隐式类型转换
- 2.8.2.运算符重载
- 2.8.3.数组访问
- 2.8.4.选择函数
- 2.8.5.枚举抽象类型
- 2.8.6.转发抽象类型字段
- 2.8.7.核心类型抽象
- 2.9.单形
- 3.类型系统
- 3.1.Typedef
- 3.1.1.扩展
- 3.2.类型参数
- 3.2.1.约束
- 3.3.泛型
- 3.3.1.泛型类型参数解释
- 3.4.变异
- 3.5.统一
- 3.5.1.类/接口 之间
- 3.5.2.结构子类型化
- 3.5.3.单形
- 3.5.4.函数返回
- 3.5.5.通用基本类型
- 3.6.类型推断
- 3.6.1.由上而下推断
- 3.6.2.局限
- 3.7.模块和路径
- 3.7.1.模块子类型
- 3.7.2.Import
- 3.7.3.解析顺序
- 4.类字段
- 4.1.变量
- 4.2.属性
- 4.2.1.常见访问标识符组合
- 4.2.2.对类型系统的影响
- 4.2.3.getter和setter的规则
- 4.3.方法
- 4.3.1.重写方法
- 4.3.2.变异和访问修饰符的影响
- 4.4.访问修饰符
- 4.4.1.可见性
- 4.4.2.Inline
- 4.4.3.Dynamic
- 4.4.4.Override
- 4.4.5.Static
- 5.表达式
- 5.1.块
- 5.2.常量
- 5.3.二元操作符
- 5.4.一元操作符
- 5.5.数组声明
- 5.6.对象声明
- 5.7.字段访问
- 5.8.数组访问
- 5.9.函数调用
- 5.10.var
- 5.11.局部函数
- 5.12.new
- 5.13.for
- 5.14.while
- 5.15.do-while
- 5.16.if
- 5.17.switch
- 5.18.try/catch
- 5.19.return
- 5.20.break
- 5.21.continue
- 5.22.throw
- 5.23.类型转换
- 5.23.1.不安全转换
- 5.23.2.安全转换
- 5.24.类型检查
- 6.语言特性
- 6.1.条件编译
- 6.2.Externs
- 6.3.静态扩展
- 6.3.1.标准库中的静态扩展
- 6.4.模式匹配
- 6.4.1.介绍
- 6.4.2.枚举匹配
- 6.4.3.变量捕获
- 6.4.4.结构匹配
- 6.4.5.数组匹配
- 6.4.6.Or 模式
- 6.4.7.守护
- 6.4.8.多个值的匹配
- 6.4.9.提取器
- 6.4.10.穷尽性检查
- 6.4.11.无效的模式检查
- 6.5.字符串插值
- 6.6.数组推导
- 6.7.迭代器
- 6.8.函数绑定
- 6.9.元数据
- 6.10.访问控制
- 6.11.内联构造函数
- 7.编译器用法
- 7.1.编译器标记
- 8.编译器功能
- 8.1.内建编译器元数据
- 8.2.无用代码消除
- 8.3.编译器服务
- 8.3.1.概述
- 8.3.2.字段访问完成
- 8.3.3.调用参数完成
- 8.3.4.类型路径完成
- 8.3.5.使用完成
- 8.3.6.位置完成
- 8.3.7.顶级完成
- 8.3.8.完成服务
- 8.4.资源
- 8.4.1.嵌入资源
- 8.4.2.检索文本资源
- 8.4.3.检索二进制资源
- 8.4.4.实现细节
- 8.5.运行时类型信息
- 8.5.1.RTTI 结构
- 8.6.静态分析仪
- 9.宏
- 9.1.宏上下文
- 9.2.参数
- 9.2.1.ExprOf
- 9.2.2.常数表达式
- 9.2.3.其它的参数
- 9.3.具体化
- 9.3.1.表达式具体化
- 9.3.2.类型具体化
- 9.3.3.类具体化
- 9.4.工具
- 9.5.类型构建
- 9.5.1.枚举构建
- 9.5.2.@:autoBuild
- 9.5.3.@:genericBuild
- 9.6.限制
- 9.6.1.Macro-in-Macro
- 9.6.2.静态扩展
- 9.6.3.构建顺序
- 9.6.4.类型参数
- 9.7.初始化宏
- 10.标准库
- 10.1.字符串
- 10.2.数据结构
- 10.2.1.数组
- 10.2.2.向量
- 10.2.3.列表
- 10.2.4.GenericStack
- 10.2.5.Map
- 10.2.6.Option
- 10.3.正则表达式
- 10.3.1.匹配
- 10.3.2.分组
- 10.3.3.替换
- 10.3.4.分割
- 10.3.5.Map
- 10.3.6.实现细节
- 10.4.Math
- 10.4.1.特殊数值
- 10.4.2.数学错误
- 10.4.3.整数数学
- 10.4.4.扩展
- 10.5.Lambda
- 10.6.模板
- 10.7.反射
- 10.8.序列化
- 10.8.1.格式化序列化
- 10.9.Xml
- 10.9.1.开始使用Xml
- 10.9.2.解析Xml
- 10.9.3.编码Xml
- 10.10.Json
- 10.10.1.解析JSON
- 10.10.2.编码JSON
- 10.10.3.实现细节
- 10.11.Input/Output
- 10.12.Sys/sys
- 10.13.远程处理
- 10.13.1.远程连接
- 10.13.2.实现细节
- 10.14.单元测试
- 11.Haxelib
- 11.1.Haxe编译器使用库
- 11.2.haxelib.json
- 11.2.1.版本控制
- 11.2.2.依赖关系
- 11.3.extraParams.hxml
- 11.4.使用Haxelib
- 12.目标平台细节
- 12.1.JavaScript
- 12.1.1.开始使用Haxe/JavaScript
- 12.1.2.使用外部JavaScript库
- 12.1.3.注入原生JavaScript
- 12.1.4.JavaScript untyped函数
- 12.1.5.调试JavaScript
- 12.1.6.JavaScript目标元数据
- 12.1.7.为JavaScript暴露Haxe类
- 12.1.8.使用 require函数加载外部类
- 12.2.Flash
- 12.2.1.开始使用Haxe/Flash
- 12.2.2.嵌入资源
- 12.2.3.使用外部Flash库
- 12.2.4.Flash目标元数据
- 12.3.Neko
- 12.4.PHP
- 12.4.1.开始使用Haxe/PHP
- 12.4.2.PHP untyped函数
- 12.5.C++
- 12.5.1.Using C++定义
- 12.5.2.Using C++ 指针
- 12.6.Java
- 12.7.C#
- 12.8.Python