Trail:

Introduction

Following the principles in Code generation using Javadoc AsDoclet is build upon javadoc. To annotate classes as to be processed just a single @actionscript.class tag in the class documentation is necessary. That way a simple class that defines properties following the Java Bean convention will be converted into an identical Actionscript class.

AsDoclet can not just process Java Bean classes, it can also handle interfaces and generate proxies. For more information see the Tag Reference.

Example

Java Class

package org.fluffnstuff.entities;

import java.util.Date;

/**
 * Some base class.
 *
 * @actionscript.class
 */
public class EntityObject {
        private long id;
        private Long version;

        public long getId() {
                return id;
        }

        /**
         * Set the entities unique id.
         *
         * @param id The id.
         */
        public final void setId(long id) {
                this.id = id;
        }

        public Long getVersion() {
                return version;
        }

        /**
         * Set the entities version.
         *
         * @param version The version.
         */
        public void setVersion(Long version) {
                this.version = version;
        }
}

Generated Actionscript Class

package  org.fluffnstuff.entities{
        /**
         * Some base class.
         * 
         * Generated by AsDoclet from org.fluffnstuff.entities.EntityObject.
         * Do not edit.
         */
        [RemoteClass(alias="org.fluffnstuff.entities.EntityObject")]
        public class EntityObject {
                private var _id:Number;
                public function get id():Number {
                        return _id;
                }
                public function set id(value:Number):void {
                        _id=value;
                }
                private var _version:Object;
                public function get version():Object {
                        return _version;
                }
                public function set version(value:Object):void {
                        _version=value;
                }
        }
}