This project generates the as3 (Flex) files for the java files.
Attributes:
- name - The name of the generated AS class. Should be same as the java class name. Required.
- generate - On false, does not generate the AS file for the java class. Default: true.
- generate-bindable-metadata - Generates [Bindable] at class level in AS. Default value: true.
- generate-remote-class-metadata - Generates [RemoteClass(alias="..")] on true. Default value: false.
Attributes:
- type - The fully qualified flex type to be generated in the AS file. Required.
- import - Imports the flex type defined above. Default: false.
- generate-bindable-field-metadata - Generate field level [Bindable] in the AS file. Default: false.
- generate - Controls generation of the field in as files. Default: true.
- int - Number
- double - Number
- long - Number
- java.lang.Short - Number
- java.lang.Byte - Number
- java.lang.Integer - Number
- java.lang.Double - Number
- java.lang.Long - Number
- java.lang.Float - Number
- java.lang.String - String
- java.lang.Character - String
- java.util.Collection - mx.collection.ArrayCollection
- java.util.Map - Object
- java.util.Dictionary - Object
For any other type define the as3.field with the flex type, and if the import is necessary. If that does not solve the problem, define it as Object, then cast it in the flex code when necessary. If this too does not solve the problem contact me on my blog. Will add the feature and release the next version.
Write a ant build script and invoke xdoclet with target:
<target name="generate">
<xdoclet>
<fileset dir="${basedir}/src">
<include name="**/*.java"/>
</fileset>
<component classname="com.bitourea.plugin.as3.As3Plugin"
destdir="${basedir}/src"/>
</xdoclet>
</target>
The sample folder has example of using all these features.
Download the jar from dist folder and put it in classpath.
api folder has the documentation.
* http://techdiary.bitourea.com/2008/10/as-model-generator-xdoclet2-plugin-to.html or http://sacrosanctblood.blogspot.com/2008/10/as-model-generator-xdoclet2-plugin-to.html
* http://techdiary.bitourea.com/2008/10/xdoclet2-custom-plugin-actionscript3.html or http://sacrosanctblood.blogspot.com/2008/10/xdoclet2-custom-plugin-actionscript3.html
Released under MIT license, go ahead and use, modify, distribute as you wish. The license is provided in LICENSE.txt. The license of other libraries used must be used as defined by them.