Other than the missing static const, the rest looks correct to me.  When you 
use [Bindable], the class is "re-based" on top of EventDispatcher if the base 
class isnnt' already an IEventDispatcher.  [Bindable] requires the dispatching 
of change events.

HTH,
-Alex

On 10/6/18, 11:33 AM, "Carlos Rovira" <[email protected]> wrote:

    Hi,
    
    I'm trying to do some Reflection work and finding some unexpected results.
    Given this example class:
    
    package controllers
    {
    import interfaces.IController;
    
    import models.User;
    
    import services.UserService;
    
    public class UserController implements IController
    {
    public static const USER_CONTROLLER_EVENT:String = "userControllerEvent";
    
    /**
             * Constructor
             */
    public function UserController()
    {
    trace("UserController constructor");
    }
    
    private var _userService:UserService;
    
    [Inject]
    public function get userService():UserService
    {
        return _userService;
    }
    public function set userService(value:UserService):void
    {
    trace("setting userService: ", value);
        _userService = value;
    }
    [Bindable]
    public var currentUser:User;
    }
    }
    
    I want to retrieve, super class, interface, metadata, const and vars and
    methods, so I think I should use this:
    
    var typeDefinition:TypeDefinition = describeType(target);
    
    To see what this retrieves for this email the toString method is great:
    
    typeDefinition.toString(true);
    
    RESULT:
    
    *typeDefinition.toString  Typedefinition: controllers.UserController,
    kind:class*
    *constructor :*
    * method: 'UserController', returnType:''
    declaredBy:controllers.UserController*
    * {No parameters}*
    *interfaces :*
    * Typedefinition: interfaces.IController, kind:interface*
    * Typedefinition: org.apache.royale.events.IEventDispatcher,
    kind:interface. <---- this is unexpected*
    *baseClasses :*
    * Typedefinition: org.apache.royale.events.EventDispatcher, kind:class. 
**<----
    this is unexpected*
    *variables :*
    * {none}*
    *accessors :*
    * accessor: 'currentUser' access:readwrite, type:models.User,
    declaredBy:controllers.UserController*
    * accessor: 'userService' access:readwrite, type:services.UserService,
    declaredBy:controllers.UserController*
    *methods :*
    * method: 'hasEventListener', returnType:Boolean
    declaredBy:org.apache.royale.events.EventDispatcher.  **<---- this is
    unexpected (but normal due to EventDispatcher listed as base class*
    * parameter 1, optional:false, type:String*
    * method: 'dispatchEvent', returnType:Boolean
    declaredBy:org.apache.royale.events.EventDispatcher.  * *<---- this is
    unexpected (but normal due to EventDispatcher listed as base class*
    * parameter 1, optional:false, type:Object*
    * method: 'toString', returnType:String
    declaredBy:org.apache.royale.events.EventDispatcher * *<---- this is
    unexpected (but normal due to EventDispatcher listed as base class*
    * {No parameters}*
    *static variables :*
    * {none} *  *<---- this is unexpected where is *USER_CONTROLLER_EVENT*?*
    *static accessors :*
    * {none}*
    *static methods :*
    * {none}*
    
    As I stated in other email, the most annoying thing is the *EventDispatcher*
    and *methods* listed as super class of this class...
    the other is no *static var* listed
    
    One thing I need most is to retrieve new *Metadata* I want to insert, I'm
    taking about the [Inject] metadata, I put [Bindable] as well since is
    already used, but I don't see any signals of any one of them
    
    I must say that I have in config/compile-swf-config.xml this code:
    
    <keep-as3-metadata>
    <name>Bindable</name>
    ...
    ...
    <name>Inject</name>
    </keep-as3-metadata>
    
    and building with maven
    
    Is this a bug, or maybe this API is unfinished ? or maybe I'm missing
    something ?
    
    Thanks
    
    
    -- 
    Carlos Rovira
    
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C8371b7bda3ec4bfa38e408d62bba4216%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636744476305519236&amp;sdata=e1fU0TULU%2FeWNAptUsIrJeF%2BZtNOvADKGlntq%2B6XlXw%3D&amp;reserved=0
    

Reply via email to