Print
Actionscript plugin

Homepage of Actionscript plugin

This set of plugins supports generation of simple ActionScript classes from Java classes with xdoclet markup. Only Java classes possessing the special class tag @actionscript.class are processed by these plugins.

Both AS2 and AS3 are supported, by different plugins in this module.

The plugin org.xdoclet.plugin.actionscript.ActionScriptPlugin generates ActionScript 2 sources; the plugin

org.xdoclet.plugin.actionscript.ActionScript3Plugin generates ActionScript 3 sources.

For each processed Java class, the following are generated in the ActionScript class:

  • Superclass declaration: If the Java class extends a superclass other than Object, the generated AS class extends a superclasswith the same name.
  • Bean Properties: Each bean property in the Java class is represented by a public var in the ActionScript class, whose default type corresponds to the expected type conversion by AMF serialization. Objects of array type, java.util.List or java.util.Collection will be represented by the ActionScript Array type. The ActionScript type for the property may be overridden by using an @actionscript.property with an explicit {type=...}} parameter. If bindable, a bindable=true parameter to the same tag should be specified to generate the correct AS3 metadata.
  • Scalar Constants: Each public static final field in the Java class is a represented by a public static var in the ActionScript class with the same initializer. This is only supported for numeric and String types.
  • Serialization Preamble: All generated classes include a call to Object.registerClass() to ensure correct deserialization via AMF.
  • Imports: All referenced ActionScript data types that are not in the anonymous package are explicitly imported.

About DependencyFragmentPlugin

The plugin org.xdoclet.plugin.actionscript.DependencyFragmentPlugin processes exactly the same files referenced by the above plugin. It generates a single file named StaticDependencies.as, which is not a complete class; rather, it is a fragment of ActionScript which can be included in a Flex application to force explicit linkage of all generated ActionScript classes. This is an AS2-only feature, since the need for this mechanism in AS3 is not clear at the present time.

Powered by Atlassian Confluence