SamHaXeModule.hx

Import module proxy.

Summary
SamHaXeModule.hxImport module proxy.
Types
ImportFunctionPrototype of an import function.
CheckFunctionPrototype of an asset check function.
HelpFunctionPrototype of a help function.
SamHaXeModuleWrapper class around an import module.
Interface independent exports
INTERFACESName of array variable of supported interface versions.
DESCRIPTIONName of string variable of short module description.
INIT_MODULEName of module initializatoon function.
Interface dependent exports
IMPORT_FUN_1_0Name of asset importing function in module interface version 1.0.
CHECK_FUN_1_0Name of XML node checking function in module interface version 1.0.
HELP_FUN_1_0Name of module help function in module interface version 1.0.
genclass attribute constants
GENCLASS_FALSEDon’t generate neither symbol class nor AS3 class stub.
GENCLASS_SYMBOL_ONLYGenerate only symbol class.
GENCLASS_SYMBOL_AND_CLASSGenerate symbol class and AS3 class stub.
Interface independent members and methods
newConstructor
isCompatibleVersionChecks if the given module interface version is compatible with the requested.
getCompatibleVersionLooks up the module interface of highest possible version constrained by the required version and the interface versions supported by SamHaXe.
initInitializes the module by selecting and exposing a compatible module interface.
getDescriptionthe short description of the module
getImportFunctionthe import function for handling xml fragments
getCheckFunctionthe check function for validating xml fragments, or null if such function is not exported
getHelpFunctionthe help function for displaying module-specific help message, or null if such function is not exported

Types

ImportFunction

Prototype of an import function.

NsFastXml -> Hash<String> -> Array<SWFTag>

CheckFunction

Prototype of an asset check function.

Used for validating the structure of the asset XML node to be processed by the import function.

NsFastXml -> Void

HelpFunction

Prototype of a help function.

Returns the long help message provided by an import module.

Void -> String

SamHaXeModule

Wrapper class around an import module.

Summary
Interface independent exports
INTERFACESName of array variable of supported interface versions.
DESCRIPTIONName of string variable of short module description.
INIT_MODULEName of module initializatoon function.
Interface dependent exports
IMPORT_FUN_1_0Name of asset importing function in module interface version 1.0.
CHECK_FUN_1_0Name of XML node checking function in module interface version 1.0.
HELP_FUN_1_0Name of module help function in module interface version 1.0.
genclass attribute constants
GENCLASS_FALSEDon’t generate neither symbol class nor AS3 class stub.
GENCLASS_SYMBOL_ONLYGenerate only symbol class.
GENCLASS_SYMBOL_AND_CLASSGenerate symbol class and AS3 class stub.
Interface independent members and methods
newConstructor
isCompatibleVersionChecks if the given module interface version is compatible with the requested.
getCompatibleVersionLooks up the module interface of highest possible version constrained by the required version and the interface versions supported by SamHaXe.
initInitializes the module by selecting and exposing a compatible module interface.
getDescriptionthe short description of the module
getImportFunctionthe import function for handling xml fragments
getCheckFunctionthe check function for validating xml fragments, or null if such function is not exported
getHelpFunctionthe help function for displaying module-specific help message, or null if such function is not exported

Interface independent exports

INTERFACES

public inline static var INTERFACES

Name of array variable of supported interface versions.

DESCRIPTION

public inline static var DESCRIPTION

Name of string variable of short module description.

INIT_MODULE

public inline static var INIT_MODULE

Name of module initializatoon function.

Interface dependent exports

IMPORT_FUN_1_0

public inline static var IMPORT_FUN_1_0

Name of asset importing function in module interface version 1.0.

CHECK_FUN_1_0

public inline static var CHECK_FUN_1_0

Name of XML node checking function in module interface version 1.0.

HELP_FUN_1_0

public inline static var HELP_FUN_1_0

Name of module help function in module interface version 1.0.

genclass attribute constants

GENCLASS_FALSE

public inline static var GENCLASS_FALSE

Don’t generate neither symbol class nor AS3 class stub.

GENCLASS_SYMBOL_ONLY

public inline static var GENCLASS_SYMBOL_ONLY

Generate only symbol class.

GENCLASS_SYMBOL_AND_CLASS

public inline static var GENCLASS_SYMBOL_AND_CLASS

Generate symbol class and AS3 class stub.

Interface independent members and methods

new

public function new(module_name: String,
uri: String)

Constructor

Parameters

module_namethe short name of the module (equals the module file name without the .n extension)
urithe unique namespace uri of the module, without the interface version selector anchor

isCompatibleVersion

public function isCompatibleVersion(version: String,
req_version: String): Bool

Checks if the given module interface version is compatible with the requested.  The interface version is expected to be in Major.Minor.Bugfix format, while the requested version may omit the bugfix or the minor and bugfix levels - in these cases the corrseponding levels are not checked.  All checked levels have to match in order the test to pass.

Parameters

versionthe interface version in Major.Minor.Bugfix format
req_versionthe interface version requested by the resource xml file, in Major[.Minor[.Bugfix]] format

Returns

the result of the compatibility test

getCompatibleVersion

public function getCompatibleVersion(supported_versions: Array<String>,
required_version: String): String

Looks up the module interface of highest possible version constrained by the required version and the interface versions supported by SamHaXe.

Omitting version levels means that getCompatibleVersion is free to choose any version for the given levels.

Parameters

supported_versionsinterface versions supported by SamHaXe in Major[.Minor[.Bugfix]] format
required_versionthe interface version requested by the resource xml file, in Major[.Minor[.Bugfix]] format

Returns

the chosen version string

init

public function init(supported_versions: Array<String>,
required_version: String,
moduleServices : String -> Dynamic)

Initializes the module by selecting and exposing a compatible module interface.  See getCompatibleVersion for interface selection details.

Parameters

supported_versionsinterface versions supported by SamHaXe in Major[.Minor[.Bugfix]] format
required_versionthe interface version requested by the resource xml file, in Major[.Minor[.Bugfix]] format
moduleServicesfunction to request the Module Services interface for a given interface version.  See SamHaXe::getModuleService.

getDescription

public function getDescription(): String

Returns

the short description of the module

getImportFunction

public function getImportFunction(): ImportFunction

Returns

the import function for handling xml fragments

getCheckFunction

public function getCheckFunction(): CheckFunction

Returns

the check function for validating xml fragments, or null if such function is not exported

getHelpFunction

public function getHelpFunction(): HelpFunction

Returns

the help function for displaying module-specific help message, or null if such function is not exported

public inline static var INTERFACES
Name of array variable of supported interface versions.
public inline static var DESCRIPTION
Name of string variable of short module description.
public inline static var INIT_MODULE
Name of module initializatoon function.
public inline static var IMPORT_FUN_1_0
Name of asset importing function in module interface version 1.0.
public inline static var CHECK_FUN_1_0
Name of XML node checking function in module interface version 1.0.
public inline static var HELP_FUN_1_0
Name of module help function in module interface version 1.0.
public inline static var GENCLASS_FALSE
Don’t generate neither symbol class nor AS3 class stub.
public inline static var GENCLASS_SYMBOL_ONLY
Generate only symbol class.
public inline static var GENCLASS_SYMBOL_AND_CLASS
Generate symbol class and AS3 class stub.
public function new(module_name: String,
uri: String)
Constructor
public function isCompatibleVersion(version: String,
req_version: String): Bool
Checks if the given module interface version is compatible with the requested.
public function getCompatibleVersion(supported_versions: Array<String>,
required_version: String): String
Looks up the module interface of highest possible version constrained by the required version and the interface versions supported by SamHaXe.
public function init(supported_versions: Array<String>,
required_version: String,
moduleServices : String -> Dynamic)
Initializes the module by selecting and exposing a compatible module interface.
public function getDescription(): String
the short description of the module
public function getImportFunction(): ImportFunction
the import function for handling xml fragments
public function getCheckFunction(): CheckFunction
the check function for validating xml fragments, or null if such function is not exported
public function getHelpFunction(): HelpFunction
the help function for displaying module-specific help message, or null if such function is not exported
public function getModuleService(if_version String) : Dynamic
Returns an instance of requested version of module service.
Close