8.1 Built-in Compiler Metadata

Starting from Haxe 3.0, you can get the list of defined compiler metadata by running haxe --help-metas

Global metadata
MetadataDescriptionPlatform
@:abiFunction ABI/calling conventioncpp
@:abstractSets the underlying class implementation as 'abstract'cs java
@:access (Target path)Forces private access to package type or field, see Access Controlall
@:allow (Target path)Allows private access from package type or field, see Access Controlall
@:analyzerUsed to configure the static analyzerall
@:annotationAnnotation (@interface) definitions on -java-lib imports will be annotated with this metadata. Has no effect on types compiled by Haxejava
@:arrayAccessAllows Array access on an abstractall
@:autoBuild (Build macro call)Extends @:build metadata to all extending and implementing classes. See Macro autobuildall
@:bindOverride Swf class declarationflash
@:bitmap (Bitmap file path)_Embeds given bitmap data into the class (must extend flash.display.BitmapData)flash
@:bridgePropertiesCreates native property bridges for all Haxe properties in this classcs
@:build (Build macro call)Builds a class or enum from a macro. See Type Buildingall
@:buildXmlSpecify xml data to be injected into Build.xmlcpp
@:callableAbstract forwards call to its underlying typeall
@:classCodeUsed to inject platform-native code into a classcs java
@:commutativeDeclares an abstract operator as commutativeall
@:compilerGeneratedMarks a field as generated by the compiler. Shouldn't be used by the end usercs java
@:coreApiIdentifies this class as a core api class (forces Api check)all
@:coreTypeIdentifies an abstract as core type so that it requires no implementationall
@:cppFileCodeCode to be injected into generated cpp filecpp
@:cppIncludeFile to be included in generated cpp filecpp
@:cppNamespaceCodecpp
@:dceForces Dead Code Elimination even when not -dce full is specifiedall
@:debugForces debug information to be generated into the Swf even without -debugflash
@:declcpp
@:defParamall
@:delegateAutomatically added by -net-lib on delegatescs
@:dependcpp
@:deprecatedAutomatically added by -java-lib on class fields annotated with @Deprecated annotation. Has no effect on types compiled by Haxejava
@:eventAutomatically added by -net-lib on events. Has no effect on types compiled by Haxecs
@:enumDefines finite value sets to abstract definitions. See enum abstractsall
@:expose (?Name=Class path)Makes the class available on the window object or exports for node.js. See exposing Haxe classes for JavaScriptjs
@:externMarks the field as extern so it is not generatedall
@:fakeEnum (Type name)Treat enum as collection of values of the specified typeall
@:file(File path)Includes a given binary file into the target Swf and associates it with the class (must extend flash.utils.ByteArray)flash
@:finalPrevents a class from being extendedall
@: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 typeall
@:fromSpecifies that the field of the abstract is a cast operation from the type identified in the function. See Implicit Castsall
@:functionCodeInjects native code into the beginning of the functioncs cpp
@:functionTailCodeInjects native code into the end of the functioncpp
@:genericMarks a class or class field as generic so each type parameter combination generates its own type/fieldall
@:genericBuildBuilds instances of a type using the specified macroall
@:getter (Class field name)Generates a native getter function on the given fieldflash
@:hackAllows extending classes marked as @:finalall
@:headerClassCodeCode to be injected into the generated class, in the headercpp
@:headerCodeCode to be injected into the generated header filecpp
@:headerNamespaceCodecpp
@:hxGenAnnotates that an extern class was generated by Haxecs java
@:ifFeature (Feature name)Causes a field to be kept by DCE if the given feature is part of the compilationall
@:includecpp
@:initPackageall
@:internalGenerates the annotated field/class with internal accesscs java
@:isVarForces a physical field to be generated for properties that otherwise would not require oneall
@:javaCanonical (Output type package,Output type name)Used by the Java target to annotate the canonical path of the typejava
@:jsRequireGenerate javascript module require expression for given externjs
@:keepCauses a field or type to be kept by DCEall
@:keepInitCauses a class to be kept by DCE even if all its field are removedall
@:keepSubExtends @:keep metadata to all implementing and extending classesall
@:macro(deprecated)all
@:mergeBlockMerge the annotated block into the current scopeall
@:metaInternally used to mark a class field as being the metadata fieldall
@:multiType (Relevant type parameters)Specifies that an abstract chooses its this-type from its @:to functionsall
@:native (Output type path)Rewrites the path of a class or enum during generationall
@:nativeAdd the native keyword to the generated field (JNI)java
@:nativeChildrenAnnotates that all children from a type should be treated as if it were an extern definition - platform nativecs java
@:nativeGenAnnotates that a type should be treated as if it were an extern definition - platform nativecs java
@:nativePropertyUse native properties which will execute even with dynamic usagecpp
@:noCompletionPrevents the compiler from suggesting completion on this fieldall
@:noDebugDoes not generate debug information into the Swf even if -debug is setflash
@:noDocPrevents a type from being included in documentation generationall
@:noImportGlobalPrevents a static field from being imported with import Class.*all
@:noPrivateAccessDisallow private access to anything for the annotated expressionall
@:noStackcpp
@:noUsingPrevents a field from being used with usingall
@:nonVirtualDeclares function to be non-virtualcpp
@:notNullDeclares an abstract type as not accepting null valuesall
@:nsInternally used by the Swf generator to handle namespacesflash
@:op (The operation)Declares an abstract field as being an operator overloadall
@:optionalMarks the field of a structure as optional. See Optional Argumentsall
@:overload (Function specification)Allows the field to be called with different argument types. Function specification cannot be an expressionall
@:privateAccessAllow private access to anything for the annotated expressionall
@:propertyMarks a property field to be compiled as a native C# propertycs
@:protectedMarks a class field as being protectedall
@:publicMarks a class field as being publicall
@:publicFieldsForces all class fields of inheriting classes to be publicall
@:pythonImportGenerates python import statement for extern classespython
@:readOnlyGenerates a field with the readonly native keywordcs
@:removeCauses an interface to be removed from all implementing classes before generationall
@:require (Compiler flag to check)Allows access to a field only if the specified compiler flag is setall
@:rttiAdds runtime type informations. See RTTIall
@:runtimeall
@:runtimeValueMarks an abstract as being a runtime valueall
@:selfCallTranslates method calls into calling object directlyjs
@:setter (Class field name)Generates a native setter function on the given fieldflash
@: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
@:sourceFileSource code filename for external classcpp
@:strictUsed to declare a native C# attribute or a native Java metadata. Is type checkedcs java
@:structMarks a class definition as a structcs
@:structAccessMarks an extern class as using struct access('.') not pointer('->')cpp
@:suppressWarningsAdds a SuppressWarnings annotation for the generated Java classjava
@:throws (Type as String)Adds a throws declaration to the generated functionjava
@:toSpecifies that the field of the abstract is a cast operation to the type identified in the function. See Implicit Castsall
@:transientAdds the transient flag to the class fieldjava
@:unboundCompiler internal to denote unbounded global variableall
@:unifyMinDynamicAllows a collection of types to unify to Dynamicall
@:unreflectivecpp
@:unsafeDeclares a class or a method with the C#'s unsafe flagcs
@:usageall
@:valueUsed to store default values for fields and function argumentsall
@:voidUse Cpp native 'void' return typecpp
@:volatilecs java